"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[25619],{597104(e,t,n){n.d(t,{E:()=>o});const o=e=>{const t=e;return t.__isSiteQuery=!0,t}},441966(e,t,n){n.d(t,{I:()=>a});var o=n(814328),s=n(602086),r=n(409033);const a=()=>{const e=(0,o.jE)(),t=(0,r.R)();return(0,s.useCallback)(n=>{e.invalidateQueries(n(t))},[e,t])}},208047(e,t,n){n.d(t,{r:()=>l});var o=n(226586),s=n(219582),r=n(437007),a=n(565744);const i=(0,o.Ay)({baseUrl:"/v2",fetch:(...e)=>(0,r.n)(...e).then(a.x9)}),l=(0,s.A)(i)},633502(e,t,n){n.d(t,{J:()=>a});var o=n(597104),s=n(208047),r=n(455425);const a=(0,o.E)(({siteName:e})=>s.r.queryOptions("get","/api/site/{siteName}/routes",{params:{path:{siteName:e}}},{staleTime:30*r.vl}))},486061(e,t,n){n.d(t,{VT:()=>a,i9:()=>s,ng:()=>i,nt:()=>r});var o=n(751271);const s=n(409844).AH`
  font-size: ${o.Ay["font-size-m"]};
  font-weight: normal;
  border-radius: 0;
`,r=112,a=20,i=345},531984(e,t,n){n.d(t,{w:()=>a});var o=n(602086),s=n(977872),r=n(205521);const a=e=>{const t=(0,s.wA)();(0,o.useEffect)(()=>{t((0,r.SQ)(e))},[t,e])}},762542(e,t,n){n.d(t,{y:()=>s});var o=n(531984);const s=e=>(0,o.w)(e.formState.isDirty)},535322(e,t,n){n.d(t,{A:()=>g,I:()=>o});var o,s=n(274934),r=n(505817),a=n(753583),i=n(247816),l=n(565527),d=n(309130),c=n(100978),m=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(o||(o={}));const u=(0,i.A)(c.A,(0,m.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${r.Ay[`desktop-border-divider-${t}`]};`:""}
  padding: ${({isButtonList:e,padding:t})=>t||(e?`0 ${d.Ln}`:d.Ln)};
  margin-bottom: ${({marginBottom:e})=>e||d.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  `:""}
`,p=(0,i.A)(a.A,(0,m.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
  ${({nested:e,theme:{themeName:t}})=>e?`border: ${r.Ay[`desktop-border-divider-${t}`]};`:""}
  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,nested:t,theme:{themeName:n}})=>e||r.Ay[n===l.S.DARK?`desktop-color-neutral-${t?"00":"01"}-${l.S.DARK}`:`desktop-color-neutral-${t?"01":"00"}-${l.S.LIGHT}`]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0;
      > div {
        padding: 0 ${d.Ln} ${d.Ln};
      }
    }
  }
`,g=({type:e,marginBottom:t,margin:n,padding:r,flex:a,width:i,nested:l,...d})=>"items"in d?(0,s.jsx)(p,{marginBottom:t,margin:n,padding:r,flex:a,nested:l,...d}):(0,s.jsx)(u,{nested:l,width:i,marginBottom:t,margin:n,padding:r,flex:a,isButtonList:e===o.BUTTON_LIST,...d,children:d.children})},597750(e,t,n){n.d(t,{A:()=>a});var o=n(274934),s=n(486061),r=n(100978);const a=({maxWidth:e,label:t,children:n,...a})=>(0,o.jsxs)(r.A,{flexDirection:"column",width:"100%",maxWidth:"settingsGridContent"===e?s.ng:e,...a,children:[t,n]})},164487(e,t,n){n.d(t,{A:()=>d});var o=n(274934),s=n(903952),r=n(184931),a=n(309130),i=n(304151),l=n(100978);const d=({tooltip:e,htmlFor:t,children:n,labelProps:d,wrapperProps:c,tooltipProps:m})=>{const u=(0,r.iL)();return(0,o.jsxs)(l.A,{alignItems:"center",gap:a.YC,...c,children:[(0,o.jsx)(s.A,{as:"label",htmlFor:t,color:"tertiary",...d,style:{opacity:u?a.xN:void 0,...d?.style},children:n}),e?(0,o.jsx)(i.A,{description:e,...m}):null]})}},89469(e,t,n){n.d(t,{A:()=>i});var o=n(274934),s=n(602086),r=n(309130),a=n(100978);const i=(0,s.forwardRef)((e,t)=>(0,o.jsx)(a.A,{ref:t,flexDirection:"column",gap:r.kc,width:"100%",...e}))},787481(e,t,n){n.d(t,{A:()=>i});var o=n(274934),s=n(833466),r=n(309130),a=n(100978);const i=e=>(0,o.jsx)(a.A,{paddingTop:r.YC,paddingBottom:r.YC,gap:r.Ln,rowGap:r.YC,flexWrap:"wrap",minHeight:s.b,alignItems:"center",...e})},199742(e,t,n){n.d(t,{A:()=>d});var o=n(274934),s=n(602086),r=n(798282),a=n(309130),i=n(100978),l=n(535322);const d=({actions:e})=>(0,o.jsx)(l.A,{marginBottom:"none",children:(0,o.jsx)(i.A,{flexDirection:"column",gap:a.kc,width:"100%",children:e.filter(Boolean).map((e,t,n)=>(0,o.jsxs)(s.Fragment,{children:[e,t<n.length-1?(0,o.jsx)(i.A,{width:"100%",flexDirection:"column",paddingTop:a.YC,paddingBottom:a.YC,children:(0,o.jsx)(r.A,{orientation:"horizontal"})}):null]},[t,e.toString()].join()))})})},963428(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(977872),r=n(602086),a=n(266824),i=n(669439),l=n(897166),d=n(100978);const c=(0,r.forwardRef)(({allowReadOnly:e,disabledReason:t,...n},r)=>{const c=(0,s.d4)(l.EL)&&!e;return(0,o.jsx)(d.A,{alignItems:"center",children:(0,o.jsx)(i.A,{description:t,placement:"left",children:(0,o.jsx)(a.A,{fontSize:"medium",type:"button",...n,isDisabled:c||n.isDisabled||!!t,ref:r})})})})},756782(e,t,n){n.d(t,{A:()=>f});var o=n(274934),s=n(505817),r=n(602086),a=n(179102),i=n(247816),l=n(309130),d=n(590979),c=n(147045),m=n(291508),u=n(304151),p=n(100978),g=n(535322),h=n(89469);const A=(0,i.A)(g.A,(0,m.A)("isOutlined"))`
  border: ${({theme:{themeName:e},isOutlined:t})=>`1px solid ${t?s.Ay[`desktop-color-ublue-06-${e}`]:"transparent"}`};
`,f=({children:e,title:t,tooltip:n,tooltipProps:s,[c.L]:i,titleAction:m,isOutlined:g})=>{const f=(e=>r.Children.toArray(e).length>0)(e);return(0,o.jsx)(A,{marginBottom:"none",...d.A.addDataTestId(i??""),isOutlined:g,children:(0,o.jsxs)(p.A,{flexDirection:"column",...f&&{gap:l.Ln},width:"100%",children:[t?(0,o.jsxs)(p.A,{alignItems:"center",gap:l.YC,justifyContent:"space-between",width:"100%",children:[(0,o.jsxs)(p.A,{gap:l.YC,alignItems:"center",children:[(0,o.jsx)(a.A,{variant:"heading-medium",children:t}),n?(0,o.jsx)(u.A,{description:n,portal:!0,...s}):null]}),m?(0,o.jsx)(p.A,{children:m}):null]}):null,f?(0,o.jsx)(h.A,{children:e}):null]})})}},480562(e,t,n){n.d(t,{i:()=>a});var o=n(274934),s=n(548941),r=n(711892);const a=e=>(0,o.jsx)(s.A,{description:e.option&&"tooltipDescription"in e.option?e.option.tooltipDescription:null,position:"left",portal:!0,children:(0,o.jsx)(r.q,{...e})})},115114(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(388294),r=n(247816),a=n(409844),i=n(751636);const l=(0,r.A)("div")`
  height: 66px;
`,d=a.AH`
  padding: 0px !important;
`,c=({isDirty:e,onFormSubmit:t,onFormCancel:n,isInvalid:r,...a})=>e?(0,o.jsx)(s.A,{children:(0,o.jsx)(i.A,{isDirty:e,onFormCancel:n,onFormSubmit:t,isInvalid:r,className:d,...a})}):(0,o.jsx)(l,{})},751636(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(526744),r=n(470070),a=n(247816),i=n(291508),l=n(309130);const d=(0,a.A)("footer",(0,i.A)("hasFormResetButton"))`
  display: flex;
  justify-content: ${({hasFormResetButton:e})=>e?"space-between":"flex-end"};
  padding: ${l.S2} ${l.fS};
  gap: ${l.kc};
`,c=({allowCancel:e,isDirty:t,isInvalid:n,isSubmitting:a,onFormSubmit:i,onFormReset:l,onFormCancel:c,className:m,submitButtonText:u,customButton:p,applyButton:g,hideCancelButton:h,form:A,testConfigFooter:f})=>(0,o.jsx)(d,{className:m,hasFormResetButton:!!l,children:f||(0,o.jsxs)(o.Fragment,{children:[p,h?null:(0,o.jsx)(s.A,{name:"cancel",variant:"default",type:"button",onClick:c,disabled:!e&&!t,children:(0,o.jsx)(r.sA,{id:"COMMON_ACTION_CANCEL"})}),l?(0,o.jsx)(s.A,{name:"reset",variant:"default",type:"button",onClick:l,disabled:!t,children:(0,o.jsx)(r.sA,{id:"COMMON_ACTION_RESET_TO_DEFAULT"})}):null,g||(0,o.jsx)(s.A,{name:"submit",variant:"primary",type:"submit",onClick:i,disabled:!t||n||a,form:A,children:(0,o.jsx)(r.sA,{id:u||"COMMON_ACTION_APPLY_CHANGES"})})]})})},420174(e,t,n){n.d(t,{H5:()=>a,ZS:()=>i});var o=n(274934),s=n(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,n]=(0,s.useState)(""),a=(0,s.useMemo)(()=>({sharedName:t,setSharedName:n}),[t]);return(0,o.jsx)(r.Provider,{value:a,children:e})}},783920(e,t,n){n.r(t),n.d(t,{default:()=>r});var o=n(274934),s=n(129401);const r=({activeItem:e})=>(0,o.jsx)(s.A,{activeItem:e},e?._id)},833466(e,t,n){n.d(t,{b:()=>o});const o=32},121713(e,t,n){n.d(t,{m:()=>g});var o=n(602086),s=n(977872),r=n(42220),a=n(369289),i=n(721533),l=n(700444),d=n(159469),c=n(260334);const m=(e,t=[])=>{if(!e||"object"!=typeof e)return[];const n=e;return[...Object.keys(n).filter(e=>"ref"!==e).flatMap(e=>m(n[e],[...t,e])),..."string"==typeof n.message&&n.message?[{path:n.ref?.name??t.join("."),message:n.message}]:[]]},u=e=>[...Array.from(document.getElementsByName(e)),document.getElementById(e),document.querySelector(`label[for="${e}"]`),document.querySelector(`[data-field-error="${e}"]`)].find(e=>e instanceof HTMLElement&&null!==e.offsetParent)??null,p=e=>{const t=(e.split(".").pop()??e).replaceAll(/([a-z0-9])([A-Z])/g,"$1 $2").replaceAll(/[_-]+/g," ").trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):e};function g({schema:e,defaultValues:t,presets:n,mode:g="onTouched"}){const h=(0,s.wA)(),A=(0,c.L_)(),f=(0,o.useMemo)(()=>n?(0,a.A)(n,e=>e.defaultValues):{},[n]),x=(0,o.useMemo)(()=>({...t,...f}),[f,t]),v=(0,r.mN)({resolver:(0,i.u)(e),shouldFocusError:!0,defaultValues:x,shouldUseNativeValidation:!1,mode:g}),b=(0,o.useRef)(x);b.current=x;const E=(0,o.useRef)(null),{submitCount:_}=v.formState;(0,o.useEffect)(()=>{const e=E.current;if(E.current=null,!e)return;const t=m(e),n=t[0],o=n?.path??Object.keys(e)[0];if(o)try{const e=t.map(e=>u(e.path)).find(Boolean)??(t.length?null:u(o));if(e)e.scrollIntoView?.({behavior:"smooth",block:"center"}),e.focus?.({preventScroll:!0});else{const e=n&&A(n.message);h((0,l.ox)(n&&e?{icon:d.C.danger,title:"COMMON_VALIDATION_HIDDEN_FIELDS_TITLE",translateTitle:!0,message:"COMMON_VALIDATION_HIDDEN_FIELDS_DETAIL",values:{field:p(n.path),message:e}}:{icon:d.C.danger,message:"COMMON_VALIDATION_HIDDEN_FIELDS_TITLE"}))}}catch{}},[_,h,A]);const I=(0,o.useCallback)((...e)=>{const[t,...n]=e;return v.reset(t?{...t,...f}:b.current,...n)},[f,v]);return{...v,reset:I,formState:{...v.formState,isDirty:!!Object.keys(v.formState.dirtyFields).length,isSubmitting:v.formState.isSubmitting,defaultValues:v.formState.defaultValues},handleSubmit:(...e)=>v.handleSubmit(e[0],(t,...n)=>{E.current=t,e[1]?.(t,...n)})}}},846294(e,t,n){n.d(t,{A:()=>d});var o=n(274934),s=n(548941),r=n(409844),a=n(184931),i=n(877840);const l=r.AH`
  width: fit-content;
`,d=({reasons:e,reason:t,children:n,isInteractive:r,noWrap:d,position:c,fitContent:m})=>{const u=(0,a.pv)(),p=[t,...e||[]].filter(Boolean)[0]||null,g=!!p;return(0,o.jsx)(i.A,{isDisabled:{fields:g,labels:g,tooltipIcons:g,tooltipPopovers:!u.fields&&g},children:(0,o.jsx)(s.A,{description:u.fields?null:p,portal:!0,isInteractive:r,noWrap:d,position:c,className:m?l:void 0,children:n})})}},877840(e,t,n){n.d(t,{A:()=>i});var o=n(274934),s=n(602086),r=n(184931),a=n(712642);const i=({isDisabled:e,isAdditive:t=!0,children:n})=>{const i=(0,r.pv)(),l=(0,s.useMemo)(()=>"boolean"==typeof e?{fields:e,labels:e,tooltipIcons:e,tooltipPopovers:!1}:e,[e]),d=(0,s.useMemo)(()=>({fields:t?l.fields||i.fields:l.fields,labels:t?l.labels||i.labels:l.labels,tooltipIcons:t?l.tooltipIcons||i.tooltipIcons:l.tooltipIcons,tooltipPopovers:t?l.tooltipPopovers||i.tooltipPopovers:l.tooltipPopovers}),[t,l.fields,l.labels,l.tooltipIcons,l.tooltipPopovers,i.fields,i.labels,i.tooltipIcons,i.tooltipPopovers]);return(0,o.jsx)(a.I.Provider,{value:d,children:n})}},260334(e,t,n){n.d(t,{L_:()=>c,MS:()=>d,rn:()=>l});var o=n(602086),s=n(949812),r=n(765282),a=n(470070);const i="{::}",l=(e,t)=>`${e}${i}${JSON.stringify(t??{})}`,d=(e,t)=>{if("string"!=typeof t)return;const[n,...o]=t.split(i);if(!n||!o.length)return t;let s={};try{s=Object.fromEntries(Object.entries(JSON.parse(o.join(i))).map(([t,n])=>[t,"string"==typeof n?d(e,n):n]))}catch{}return e.formatMessage({id:n},s)};function c(){const{formatMessage:e}=(0,a.tz)();return(0,o.useCallback)(t=>d({formatMessage:e},t),[e])}s.pJ((e,t)=>e.message?{message:e.message}:e.code===r.eq.too_small&&"string"===e.type?{message:l("COMMON_MIN_CHARS",{min:Number(e.minimum)})}:e.code===r.eq.too_big&&"string"===e.type?{message:l("COMMON_MAX_CHARS",{name:l("COMMON_VALUE"),max:Number(e.maximum)})}:e.code===r.eq.invalid_type&&"array"===e.expected&&"undefined"===e.received?{message:l("COMMON_SELECT_AT_LEAST_ONE_ITEM")}:e.code===r.eq.too_small&&"array"===e.type?{message:l("COMMON_ADD_AT_LEAST_X_ITEMS",{min:Number(e.minimum)})}:e.code===r.eq.invalid_type&&"undefined"===e.received?{message:l("COMMON_VALIDATION_VALUE_REQUIRED")}:e.code===r.eq.invalid_type&&"number"===e.expected?{message:l("COMMON_VALIDATION_PLEASE_ENTER_A_NUMBER")}:{message:t.defaultError})},689941(e,t,n){n.d(t,{A:()=>u});var o=n(274934),s=n(310075),r=n(42220),a=n(480562),i=n(164487),l=n(597750),d=n(147045),c=n(260334),m=n(184931);const u=function({control:e,name:t,label:n,options:u,tooltip:p,tooltipProps:g,placeholder:h,renderOption:A,onChange:f,onAfterChange:x,searchable:v,searchableProps:b,portal:E,maxHeight:_,variant:I="secondary",disableValidationMessage:S,isReadOnly:C,[d.L]:j}){const O=(0,m.mQ)(),N=(0,c.L_)();return(0,o.jsx)(r.xI,{control:e,name:t,render:({field:e,fieldState:d,formState:c})=>(0,o.jsxs)(l.A,{gap:2,children:[n?(0,o.jsx)(i.A,{htmlFor:t,tooltip:p,tooltipProps:{portal:!0,...g},children:n}):null,(0,o.jsx)(s.A,{variant:I,width:"100%",renderOption:A??a.i,options:u,...e,readOnly:C,disabled:O,onChange:(t,n)=>{const o=f?f(n,{field:e,fieldState:d,formState:c}):e.onChange(n);return x?.(n),o},value:e.value??"",invalid:d.invalid&&!S?N((0,r.Jt)(c.errors,t)?.message)||!0:void 0,placeholder:h,searchable:v,searchableProps:b,portal:E,"data-testid":j,maxHeight:_})]})})}},482609(e,t,n){n.d(t,{A:()=>m});var o=n(274934),s=n(602086),r=n(42220),a=n(87562),i=n(309130),l=n(304151),d=n(100978),c=n(184931);const m=(0,s.forwardRef)(function({control:e,name:t,children:n,tooltip:s,tooltipProps:m,value:u,onCheck:p,...g},h){const A=(0,c.mQ)();return(0,o.jsx)(r.xI,{control:e,name:t,render:({field:e})=>(0,o.jsxs)(d.A,{gap:i.YC,alignItems:"center",ref:h,...g,children:[(0,o.jsx)(a.A,{id:e.name,onChange:({target:{checked:t}})=>{t&&(e.onChange(u),p?.())},checked:e.value===u,disabled:A,value:e.value,children:n}),s?(0,o.jsx)(l.A,{description:s,...m}):null]})})})},635891(e,t,n){n.d(t,{A:()=>c});var o=n(274934),s=n(42220),r=n(699709),a=n(775250),i=n(309130),l=n(260334),d=n(184931);const c=function({control:e,name:t,label:n,placeholder:c,tooltip:m,tooltipProps:u,autoFocus:p,motif:g,onChange:h,onBlur:A,onAfterChange:f,onPaste:x,onKeyDown:v,passwordToggle:b,type:E,helperMessage:_,autoComplete:I,contentBefore:S,contentAfter:C,onFocus:j,value:O,invalid:N}){const y=(0,d.mQ)(),T=(0,d.Im)(),L=(0,d.q)(),M=(0,l.L_)();return(0,o.jsx)(s.xI,{control:e,name:t,render:({field:e,fieldState:l,formState:d})=>(0,o.jsx)(r.A,{type:E||(b?"password":"text"),variant:"secondary",width:"100%",autoFocus:p,...e,onChange:t=>{h?h(t,e,d):e.onChange(t),f?.(t)},onBlur:t=>{A?A(t,e,d):e.onBlur()},onFocus:j,onPaste:x,disabled:y,value:O??e.value?.toString(),invalid:N||(l.invalid?(0,o.jsxs)(a.A,{variant:"inherit",style:{overflowWrap:"break-word"},children:[M((0,s.Jt)(d.errors,t)?.message)||!0," "]}):void 0),label:n,placeholder:c,labelTooltip:m,labelTooltipProps:{style:{opacity:T?i.xN:void 0,pointerEvents:L?"none":void 0,...u?.style},...u},motif:g,passwordToggle:b,helperMessage:_,autoComplete:I,onKeyDown:v,contentBefore:S,contentAfter:C})})}},509927(e,t,n){n.d(t,{V:()=>a});var o=n(602086),s=n(603606);const r=e=>{const t=(0,o.useRef)(e);return(0,o.useEffect)(()=>{t.current=e},[e]),(0,o.useCallback)((...e)=>t.current(...e),[])};function a(e,t){const n=(0,o.useRef)([]),[,a]=(0,o.useState)(0),[i,l]=(0,o.useState)(null);(0,o.useEffect)(()=>{const e=setInterval(()=>{n.current.length&&t?.estimatedDurationMs&&a(e=>e+1)},1e3);return()=>clearInterval(e)},[t?.estimatedDurationMs]);const d=t?.dedupe??!1,c=r(t?.onSuccess||(()=>{})),m=r(t?.onError||(()=>{})),u=(0,o.useCallback)((...o)=>{if(d&&n.current.length)return Promise.reject();const r=(async()=>e(...o))();return n.current.push({promise:r,startedAt:Date.now()}),a(e=>e+1),r.then(e=>(c?.(e),l(e),e)).catch(async e=>{if(t?.delayOnErrorMs&&await(0,s.u)(t.delayOnErrorMs),l(null),!m)throw e;m(e)}).finally(async()=>{n.current=n.current.filter(e=>e.promise!==r),a(e=>e+1)})},[e,d,m,c,t?.delayOnErrorMs]),p=n.current.at(-1),g=p&&t?.estimatedDurationMs?Math.min((Date.now()-p.startedAt)/t.estimatedDurationMs,.9):void 0;return{execute:u,isLoading:!!n.current.length,lastData:i,estimatedProgress:g}}},292027(e,t,n){n.d(t,{A:()=>A});var o=n(274934),s=n(199742),r=n(977872),a=n(159469),i=n(464920),l=n(509927),d=n(963428),c=n(700444),m=n(470070);const u=({onResume:e,disabledReason:t})=>{const n=(0,r.wA)(),s=(0,l.V)(()=>e(),{onError:e=>{const t=(0,i.F)(e)?e:void 0;return n((0,c.ox)({icon:a.C.danger,message:"SETTINGS_POLICY_RESUME_FAILURE",values:{count:1},errorMessage:t?.msg,errorValues:t}))}});return(0,o.jsx)(d.A,{onPress:s.execute,isDisabled:s.isLoading,disabledReason:t,children:(0,o.jsx)(m.sA,{id:"COMMON_ACTION_RESUME"})})};var p=n(404056),g=n(146215);const h=({name:e,onPause:t,disabledReason:n})=>{const s=(0,r.wA)(),u=(0,l.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,o.jsx)(g.A,{trigger:(0,o.jsx)(d.A,{isDisabled:u.isLoading,disabledReason:n,children:(0,o.jsx)(m.sA,{id:"COMMON_ACTION_PAUSE"})}),confirmButtonVariant:"emphasis",title:(0,o.jsx)(m.sA,{id:"SETTINGS_SECURITY_PAUSE_POLICY_TITLE",values:{count:1}}),message:(0,o.jsx)(m.sA,{id:"SETTINGS_SECURITY_PAUSE_FIREWALL_POLICY_MESSAGE_SINGLE",values:{name:e}}),onConfirm:()=>u.execute()})},A=({enabled:e,name:t,onPause:n,pauseDisabledReason:r,onResume:a,resumeDisabledReason:i,onRemove:l,removeDisabledReason:d,removeAdditionalMessage:c})=>(0,o.jsx)(s.A,{actions:[e?(0,o.jsx)(h,{name:t,onPause:n,disabledReason:r}):(0,o.jsx)(u,{onResume:a,disabledReason:i}),(0,o.jsx)(p.A,{name:t,onRemove:l,disabledReason:d,additionalMessage:c})]})},404056(e,t,n){n.d(t,{A:()=>g});var o=n(274934),s=n(977872),r=n(159469),a=n(464920),i=n(509927),l=n(963428),d=n(146215),c=n(700444),m=n(470070),u=n(100978),p=n(309130);const g=({onRemove:e,name:t,disabledReason:n,additionalMessage:g})=>{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,o.jsx)(d.A,{trigger:(0,o.jsx)(l.A,{variant:"destructive",disabledReason:n,children:(0,o.jsx)(m.sA,{id:"COMMON_ACTION_REMOVE"})}),title:(0,o.jsx)(m.sA,{id:"SETTINGS_SECURITY_REMOVE_POLICY_TITLE",values:{count:1}}),message:g?(0,o.jsxs)(u.A,{flexDirection:"column",gap:p.kc,children:[(0,o.jsx)(m.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:t}}),g]}):(0,o.jsx)(m.sA,{id:"SETTINGS_SECURITY_REMOVE_FIREWALL_POLICY_SINGLE_MESSAGE",values:{name:t}}),onConfirm:()=>A.execute()})}},603606(e,t,n){n.d(t,{u:()=>o});const o=e=>new Promise(t=>{setTimeout(t,e)})}}]);