"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[52252],{597104(e,t,o){o.d(t,{E:()=>n});const n=e=>{const t=e;return t.__isSiteQuery=!0,t}},441966(e,t,o){o.d(t,{I:()=>a});var n=o(814328),s=o(602086),r=o(409033);const a=()=>{const e=(0,n.jE)(),t=(0,r.R)();return(0,s.useCallback)(o=>{e.invalidateQueries(o(t))},[e,t])}},208047(e,t,o){o.d(t,{r:()=>d});var n=o(226586),s=o(219582),r=o(437007),a=o(565744);const i=(0,n.Ay)({baseUrl:"/v2",fetch:(...e)=>(0,r.n)(...e).then(a.x9)}),d=(0,s.A)(i)},633502(e,t,o){o.d(t,{J:()=>a});var n=o(597104),s=o(208047),r=o(455425);const a=(0,n.E)(({siteName:e})=>s.r.queryOptions("get","/api/site/{siteName}/routes",{params:{path:{siteName:e}}},{staleTime:30*r.vl}))},531984(e,t,o){o.d(t,{w:()=>a});var n=o(602086),s=o(977872),r=o(205521);const a=e=>{const t=(0,s.wA)();(0,n.useEffect)(()=>{t((0,r.SQ)(e))},[t,e])}},762542(e,t,o){o.d(t,{y:()=>s});var n=o(531984);const s=e=>(0,n.w)(e.formState.isDirty)},535322(e,t,o){o.d(t,{A:()=>p,I:()=>n});var n,s=o(274934),r=o(814557),a=o(158885),i=o(247816),d=o(565527),l=o(309130),c=o(100978),u=o(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(n||(n={}));const m=(0,i.A)(c.A,(0,u.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:o}})=>e||r.Ay[o===d.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${d.S.LIGHT}`]};
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${l.Ln}`:l.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||l.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}})=>r.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,g=(0,i.A)(a.A,(0,u.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:o}})=>e||r.Ay[o===d.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${d.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${d.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||r.Ay[t===d.S.DARK?`desktop-color-neutral-01-${d.S.DARK}`:`desktop-color-neutral-00-${d.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${l.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${l.Ln} ${l.Ln};
      }
    }
  }
`,p=({type:e,marginBottom:t,margin:o,padding:r,flex:a,width:i,nested:d,...l})=>"items"in l?(0,s.jsx)(g,{marginBottom:t,margin:o,padding:r,flex:a,nested:d,...l}):(0,s.jsx)(m,{nested:d,width:i,marginBottom:t,margin:o,padding:r,flex:a,isButtonList:e===n.BUTTON_LIST,...l,children:l.children})},199742(e,t,o){o.d(t,{A:()=>l});var n=o(274934),s=o(602086),r=o(558948),a=o(309130),i=o(100978),d=o(535322);const l=({actions:e})=>(0,n.jsx)(d.A,{marginBottom:"none",children:(0,n.jsx)(i.A,{flexDirection:"column",gap:a.kc,width:"100%",children:e.filter(Boolean).map((e,t,o)=>(0,n.jsxs)(s.Fragment,{children:[e,t<o.length-1?(0,n.jsx)(i.A,{width:"100%",flexDirection:"column",paddingTop:a.YC,paddingBottom:a.YC,children:(0,n.jsx)(r.A,{orientation:"horizontal"})}):null]},[t,e.toString()].join()))})})},963428(e,t,o){o.d(t,{A:()=>c});var n=o(274934),s=o(977872),r=o(602086),a=o(954702),i=o(669439),d=o(897166),l=o(100978);const c=(0,r.forwardRef)(({allowReadOnly:e,disabledReason:t,...o},r)=>{const c=(0,s.d4)(d.EL)&&!e;return(0,n.jsx)(l.A,{alignItems:"center",children:(0,n.jsx)(i.A,{description:t,placement:"left",children:(0,n.jsx)(a.A,{fontSize:"medium",type:"button",...o,isDisabled:c||o.isDisabled||!!t,ref:r})})})})},420174(e,t,o){o.d(t,{H5:()=>a,ZS:()=>i});var n=o(274934),s=o(602086);const r=(0,s.createContext)(void 0),a=()=>{const e=(0,s.useContext)(r);return void 0===e?{sharedName:"",setSharedName:()=>{}}:e},i=({children:e})=>{const[t,o]=(0,s.useState)(""),a=(0,s.useMemo)(()=>({sharedName:t,setSharedName:o}),[t]);return(0,n.jsx)(r.Provider,{value:a,children:e})}},877840(e,t,o){o.d(t,{A:()=>i});var n=o(274934),s=o(602086),r=o(184931),a=o(712642);const i=({isDisabled:e,isAdditive:t=!0,children:o})=>{const i=(0,r.pv)(),d=(0,s.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),l=(0,s.useMemo)(()=>({fields:t?d.fields||i.fields:d.fields,labels:t?d.labels||i.labels:d.labels,tooltipIcons:t?d.tooltipIcons||i.tooltipIcons:d.tooltipIcons,tooltipPopovers:t?d.tooltipPopovers||i.tooltipPopovers:d.tooltipPopovers}),[t,d.fields,d.labels,d.tooltipIcons,d.tooltipPopovers,i.fields,i.labels,i.tooltipIcons,i.tooltipPopovers]);return(0,n.jsx)(a.I.Provider,{value:l,children:o})}},482609(e,t,o){o.d(t,{A:()=>u});var n=o(274934),s=o(602086),r=o(42220),a=o(956976),i=o(309130),d=o(304151),l=o(100978),c=o(184931);const u=(0,s.forwardRef)(function({control:e,name:t,children:o,tooltip:s,tooltipProps:u,value:m,onCheck:g,...p},h){const A=(0,c.mQ)();return(0,n.jsx)(r.xI,{control:e,name:t,render:({field:e})=>(0,n.jsxs)(l.A,{gap:i.YC,alignItems:"center",ref:h,...p,children:[(0,n.jsx)(a.A,{id:e.name,onChange:({target:{checked:t}})=>{t&&(e.onChange(m),g?.())},checked:e.value===m,disabled:A,value:e.value,children:o}),s?(0,n.jsx)(d.A,{description:s,...u}):null]})})})},635891(e,t,o){o.d(t,{A:()=>c});var n=o(274934),s=o(42220),r=o(843615),a=o(95032),i=o(309130),d=o(260334),l=o(184931);const c=function({control:e,name:t,label:o,placeholder:c,tooltip:u,tooltipProps:m,autoFocus:g,motif:p,onChange:h,onBlur:A,onAfterChange:v,onPaste:x,onKeyDown:f,passwordToggle:E,type:b,helperMessage:S,autoComplete:I,contentBefore:R,contentAfter:_,onFocus:C,value:T,invalid:L}){const j=(0,l.mQ)(),M=(0,l.Im)(),N=(0,l.q)(),w=(0,d.L_)();return(0,n.jsx)(s.xI,{control:e,name:t,render:({field:e,fieldState:d,formState:l})=>(0,n.jsx)(r.A,{type:b||(E?"password":"text"),variant:"secondary",width:"100%",autoFocus:g,...e,onChange:t=>{h?h(t,e,l):e.onChange(t),v?.(t)},onBlur:t=>{A?A(t,e,l):e.onBlur()},onFocus:C,onPaste:x,disabled:j,value:T??e.value?.toString(),invalid:L||(d.invalid?(0,n.jsxs)(a.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[w((0,s.Jt)(l.errors,t)?.message)||!0," "]}):void 0),label:o,placeholder:c,labelTooltip:u,labelTooltipProps:{style:{opacity:M?i.xN:void 0,pointerEvents:N?"none":void 0,...m?.style},...m},motif:p,passwordToggle:E,helperMessage:S,autoComplete:I,onKeyDown:f,contentBefore:R,contentAfter:_})})}},509927(e,t,o){o.d(t,{V:()=>a});var n=o(602086),s=o(603606);const r=e=>{const t=(0,n.useRef)(e);return(0,n.useEffect)(()=>{t.current=e},[e]),(0,n.useCallback)((...e)=>t.current(...e),[])};function a(e,t){const o=(0,n.useRef)([]),[,a]=(0,n.useState)(0),[i,d]=(0,n.useState)(null);(0,n.useEffect)(()=>{const e=setInterval(()=>{o.current.length&&t?.estimatedDurationMs&&a(e=>e+1)},1e3);return()=>clearInterval(e)},[t?.estimatedDurationMs]);const l=t?.dedupe??!1,c=r(t?.onSuccess||(()=>{})),u=r(t?.onError||(()=>{})),m=(0,n.useCallback)((...n)=>{if(l&&o.current.length)return Promise.reject();const r=(async()=>e(...n))();return o.current.push({promise:r,startedAt:Date.now()}),a(e=>e+1),r.then(e=>(c?.(e),d(e),e)).catch(async e=>{if(t?.delayOnErrorMs&&await(0,s.u)(t.delayOnErrorMs),d(null),!u)throw e;u(e)}).finally(async()=>{o.current=o.current.filter(e=>e.promise!==r),a(e=>e+1)})},[e,l,u,c,t?.delayOnErrorMs]),g=o.current.at(-1),p=g&&t?.estimatedDurationMs?Math.min((Date.now()-g.startedAt)/t.estimatedDurationMs,.9):void 0;return{execute:m,isLoading:!!o.current.length,lastData:i,estimatedProgress:p}}},292027(e,t,o){o.d(t,{A:()=>A});var n=o(274934),s=o(199742),r=o(977872),a=o(159469),i=o(464920),d=o(509927),l=o(963428),c=o(700444),u=o(470070);const m=({onResume:e,disabledReason:t})=>{const o=(0,r.wA)(),s=(0,d.V)(()=>e(),{onError:e=>{const t=(0,i.F)(e)?e:void 0;return o((0,c.ox)({icon:a.C.danger,message:"SETTINGS_POLICY_RESUME_FAILURE",values:{count:1},errorMessage:t?.msg,errorValues:t}))}});return(0,n.jsx)(l.A,{onPress:s.execute,isDisabled:s.isLoading,disabledReason:t,children:(0,n.jsx)(u.sA,{id:"COMMON_ACTION_RESUME"})})};var g=o(404056),p=o(146215);const h=({name:e,onPause:t,disabledReason:o})=>{const s=(0,r.wA)(),m=(0,d.V)(()=>t(),{onError:e=>{const t=(0,i.F)(e)?e:void 0;return s((0,c.ox)({icon:a.C.danger,message:"SETTINGS_POLICY_PAUSE_FAILURE",values:{count:1},errorMessage:t?.msg,errorValues:t}))}});return(0,n.jsx)(p.A,{trigger:(0,n.jsx)(l.A,{isDisabled:m.isLoading,disabledReason:o,children:(0,n.jsx)(u.sA,{id:"COMMON_ACTION_PAUSE"})}),confirmButtonVariant:"emphasis",title:(0,n.jsx)(u.sA,{id:"SETTINGS_SECURITY_PAUSE_POLICY_TITLE",values:{count:1}}),message:(0,n.jsx)(u.sA,{id:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_MESSAGE_SINGLE",values:{name:e}}),onConfirm:()=>m.execute()})},A=({enabled:e,name:t,onPause:o,pauseDisabledReason:r,onResume:a,resumeDisabledReason:i,onRemove:d,removeDisabledReason:l,removeAdditionalMessage:c})=>(0,n.jsx)(s.A,{actions:[e?(0,n.jsx)(h,{name:t,onPause:o,disabledReason:r}):(0,n.jsx)(m,{onResume:a,disabledReason:i}),(0,n.jsx)(g.A,{name:t,onRemove:d,disabledReason:l,additionalMessage:c})]})},404056(e,t,o){o.d(t,{A:()=>p});var n=o(274934),s=o(977872),r=o(159469),a=o(464920),i=o(509927),d=o(963428),l=o(146215),c=o(700444),u=o(470070),m=o(100978),g=o(309130);const p=({onRemove:e,name:t,disabledReason:o,additionalMessage:p})=>{const h=(0,s.wA)(),A=(0,i.V)(()=>e(),{onError:e=>{const t=(0,a.F)(e)?e:void 0;return h((0,c.ox)({icon:r.C.danger,message:"SETTINGS_POLICY_DELETE_FAILURE",values:{count:1},errorMessage:t?.msg,errorValues:t}))}});return(0,n.jsx)(l.A,{trigger:(0,n.jsx)(d.A,{variant:"destructive",disabledReason:o,children:(0,n.jsx)(u.sA,{id:"COMMON_ACTION_REMOVE"})}),title:(0,n.jsx)(u.sA,{id:"SETTINGS_SECURITY_REMOVE_POLICY_TITLE",values:{count:1}}),message:p?(0,n.jsxs)(m.A,{flexDirection:"column",gap:g.kc,children:[(0,n.jsx)(u.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:t}}),p]}):(0,n.jsx)(u.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:t}}),onConfirm:()=>A.execute()})}},603606(e,t,o){o.d(t,{u:()=>n});const n=e=>new Promise(t=>{setTimeout(t,e)})}}]);