"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[10328],{323019(e,t,n){n.d(t,{A3:()=>c,Fw:()=>h,XH:()=>d,lp:()=>A});var i=n(222102),s=n(586566),a=n(291935),o=n(197571),r=n(147433),l=n(754924);const d=(0,i.Mz)(a.bL,o.a3,(e,t)=>e&&t.every(({wan_smartq_enabled:e})=>!e)),c=(0,i.Mz)(l.U$,e=>(0,s.$F)(e)),A=(0,i.Mz)(l.U$,e=>(0,s.$F)(e)&&(e.hardware_offload??!0)),h=(0,i.Mz)(l.U$,e=>(0,s.WM)(e.fw2_caps,r.A.HWOFFLOAD_QOS_AND_SMART_QUEUE))},446863(e,t,n){n.d(t,{H5:()=>l,Lq:()=>r,n0:()=>o});var i=n(909924),s=n(573534),a=n(172205);const o=e=>e[a.U.SHARED][s.N.PROPERTY_PANEL]?.[i.Io.TAB_GET_DATA_FUNCTION]||{},r=e=>e[a.U.SHARED][s.N.PROPERTY_PANEL]?.[i.Io.TAB_SUBMIT_FUNCTION]||{},l=e=>e[a.U.SHARED][s.N.PROPERTY_PANEL]?.[i.Io.TAB_RESET_FUNCTION]||{}},680598(e,t,n){var i;n.d(t,{K:()=>i}),function(e){e.ALL="all",e.ACL_RULES="acl-rules",e.DNS_RECORDS="dns-records",e.FIREWALL="firewall",e.NAT_RULES="nat-rules",e.POLICY_BASED_ROUTES="policy-based-routes",e.PORT_FORWARDING="port-forwarding",e.QOS_RULES="qos-rules",e.STATIC_ROUTES="static-routes"}(i||(i={}))},535322(e,t,n){n.d(t,{A:()=>m,I:()=>i});var i,s=n(274934),a=n(814557),o=n(158885),r=n(247816),l=n(565527),d=n(309130),c=n(100978),A=n(291508);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(i||(i={}));const h=(0,r.A)(c.A,(0,A.A)("marginBottom","isButtonList","margin","flex","width","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.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 ${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}})=>a.Ay[`desktop-border-divider-${e}`]};\n      &:last-child {\n        border-bottom: none;\n      }\n    }\n  `:""}
`,u=(0,r.A)(o.A,(0,A.A)("marginBottom","margin","flex","padding","nested","background"))`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||a.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||a.Ay[t===l.S.DARK?`desktop-color-neutral-01-${l.S.DARK}`:`desktop-color-neutral-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};
      }
    }
  }
`,m=({type:e,marginBottom:t,margin:n,padding:a,flex:o,width:r,nested:l,...d})=>"items"in d?(0,s.jsx)(u,{marginBottom:t,margin:n,padding:a,flex:o,nested:l,...d}):(0,s.jsx)(h,{nested:l,width:r,marginBottom:t,margin:n,padding:a,flex:o,isButtonList:e===i.BUTTON_LIST,...d,children:d.children})},250266(e,t,n){n.d(t,{A:()=>c});var i=n(274934),s=n(602086),a=n(696264),o=n(409844),r=n(521376),l=n(309130),d=n(470070);const c=({children:e=null,title:t,titleValues:n,message:c,messageValues:A,handleConfirm:h=()=>null,handleClose:u=()=>null,handleCancel:m,isOpen:g,buttonVariant:C="primary",cancelButtonVariant:E="tertiary",cancelButtonMessage:_="COMMON_ACTION_CANCEL",buttonMessage:O="COMMON_ACTION_CONFIRM",buttonDisabled:b=!1,position:x="top",offset:S,showHeaderClose:p=!1,contentClassName:R="",body:T,titleBody:N,className:f,rootClose:I=!1,footerActions:j})=>{const L=(0,s.useCallback)(e=>{g&&(e.stopPropagation(),e.key===r.U.ENTER?h():e.key===r.U.ESCAPE&&u(!1))},[g,h,u]);(0,s.useEffect)(()=>(window.addEventListener("keydown",L,!0),()=>{window.removeEventListener("keydown",L,!0)}),[L]);const w=(0,s.useCallback)(()=>{u(!1),m?.()},[u,m]),$=(0,s.useCallback)(()=>{u(!1),h()},[u,h]),k=(0,s.useMemo)(()=>[{text:(0,i.jsx)(d.sA,{id:_}),variant:E,onClick:w},{text:(0,i.jsx)(d.sA,{id:O}),disabled:b,variant:C,onClick:$}],[O,C,_,E,w,$,b]),v=(0,s.useCallback)(()=>{u(!1)},[u]),M=o.AH`
    ${t?"":`margin-top: ${l.xO}`}
  `;return(0,i.jsx)(a.A,{title:t?(0,i.jsx)(d.sA,{id:t,values:n}):N||null,...c?{body:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.sA,{id:c,values:A}),T]})}:{body:T},position:x,portal:!0,offset:S,actions:j||k,showHeaderClose:p,contentClassName:o.AH`
        ${M}
        ${R}
      `,onRequestClose:v,isOpen:g,allowOverflow:!0,rootClose:I,className:f,children:e})}},341699(e,t,n){n.d(t,{HV:()=>a,pm:()=>o,vF:()=>s});var i=n(726831);const s=e=>`${i.A.fabricsOrchestration}?orchestrationId=${e?.template_id||""}&orgId=${e?.organization_id||""}`,a=e=>`${i.A.fabricsDeviceTemplates}/${e?.template_id||""}?orgId=${e?.organization_id||""}`,o=()=>`${i.A.fabricsOrchestration}`},419685(e,t,n){n.d(t,{A:()=>p});var i=n(274934),s=n(602086),a=n(770698),o=n(938984),r=n(762705),l=n(954702),d=n(247816),c=n(977872),A=n(669439),h=n(309130),u=n(793442),m=n(100978),g=n(470070),C=n(291935),E=n(598990),_=n(6276),O=n(341699);const b=(0,d.A)("div")`
  width: 100%;
  margin-bottom: ${h.Ln};
`,x=()=>{const e=(0,c.d4)(C.zu);return{isOrchestrated:(0,s.useMemo)(()=>(0,_.A)(e),[e]),globalSwitchSettings:e}},S=({globalSwitchSettings:e,children:t})=>{const n=(0,c.wA)(),a=(0,s.useCallback)(()=>{n((0,E.Np)("global_network")).then(e=>{(e?.data?.setting_keys||[]).length>0&&n((0,E.Uc)(void 0,{resolveWithExisting:!1}))})},[n]);return(0,i.jsx)(A.A,{placement:"top start",description:(0,i.jsxs)(m.A,{flexDirection:"column",width:"100%",children:[(0,i.jsx)(g.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS_MANAGED_BY_FABRIC"}),(0,i.jsxs)(m.A,{gap:h.YC,alignItems:"baseline",children:[(0,i.jsx)(u.A,{id:"COMMON_VIEW_IN_SITE_MANAGER",href:(0,O.vF)(e.cloud_template)}),(0,i.jsx)(o.A,{style:{textTransform:"lowercase"},size:"small",children:(0,i.jsx)(g.sA,{id:"COMMON_OR"})}),(0,i.jsx)(l.A,{variant:"destructive",fontSize:"inherit",onClick:a,children:(0,i.jsx)(g.sA,{id:"COMMON_DETACH"})})]})]}),children:(0,i.jsx)("div",{children:t})})},p={Toggle:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,noStyledRow:n})=>{const{isOrchestrated:r,globalSwitchSettings:l}=x(),d=(0,s.useCallback)(({target:{checked:e}})=>{t(e)},[t]),c=(0,i.jsx)(a.A,{full:!0,checked:e,onChange:d,disabled:r,children:(0,i.jsx)(m.A,{width:"100%",alignItems:"center",children:(0,i.jsx)(o.A,{size:"medium",color:r?"disabled":void 0,children:(0,i.jsx)(g.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})})})}),A=n?c:(0,i.jsx)(b,{children:c});return r?(0,i.jsx)(S,{globalSwitchSettings:l,children:A}):A},Checkbox:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,onChange:n,noStyledRow:a})=>{const{isOrchestrated:l,globalSwitchSettings:d}=x(),c=(0,s.useCallback)(({target:{checked:e}})=>{t(e),n?.(e)},[n,t]),A=(0,i.jsx)(r.A,{id:"global-switch-settings-checkbox",checked:e,onChange:c,disabled:l,children:(0,i.jsx)(o.A,{size:"medium",color:l?"disabled":void 0,children:(0,i.jsx)(g.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"})})}),h=a?A:(0,i.jsx)(b,{children:A});return l?(0,i.jsx)(S,{globalSwitchSettings:d,children:h}):h}}},604355(e,t,n){n.d(t,{A:()=>D});var i=n(274934),s=n(977872),a=n(602086),o=n(843871),r=n(599110),l=n(590979),d=n(669439),c=n(244081),A=n(724081),h=n(449339),u=n(927728),m=n(250266),g=n(120197),C=n(376527),E=n(100978),_=n(205521),O=n(470070),b=n(680598),x=n(291935),S=n(598990),p=n(179890),R=n(77157),T=n(197571),N=n(553732),f=n(615019),I=n(818028),j=n(62749),L=n(323019),w=n(969288);const $="hardware_offload",k=(0,o.bk)({enableReinitialize:!0,mapPropsToValues:({hardware_offload:e=!0})=>({[$]:e}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),v=({disabled:e})=>{const[t,n]=(0,a.useState)(!1),{setFieldValue:s,values:r}=(0,o.j7)();return(0,i.jsx)(m.A,{title:"DEVICE_HARDWARE_ACCELERATION_PROMPT_TITLE",message:"DEVICE_HARDWARE_ACCELERATION_PROMPT_DESCRIPTION",buttonMessage:"COMMON_ACTION_PROCEED",buttonVariant:"danger",showHeaderClose:!0,rootClose:!0,handleCancel:()=>{n(!1)},handleClose:()=>{n(!1)},handleConfirm:()=>{n(!1),s($,!1)},isOpen:t,children:(0,i.jsx)(g.A,{name:$,type:"realCheckbox",tooltipMessage:(0,i.jsx)(O.sA,{id:"DEVICE_HARDWARE_ACCELERATION_TOOLTIP"}),value:r[$],onChange:({target:{checked:e}})=>{e?s($,!0):n(!0)},disabled:e,children:(0,i.jsx)(O.sA,{id:"COMMON_HARDWARE_ACCELERATION"})})})},M=()=>{const e=(0,s.wA)(),t=(0,s.d4)(T.a3),n=(0,s.d4)(x.Dd),o=(0,s.d4)(p.l),m=(0,s.d4)(L.Fw),g=(0,s.d4)(I.K2);(0,a.useEffect)(()=>{e((0,j.uL)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}))},[e]);const $=(0,a.useMemo)(()=>t.find(({wan_smartq_enabled:e})=>e),[t]),k=!!$&&!m,M=o.length>0&&!m,D=n.enabled,y=(0,a.useMemo)(()=>g.some(e=>e.ip_version===f.hz.IPV6),[g]),U=k||M||D||y;return(0,A.A)([(0,R.X6)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}),(0,S.Uc)(void 0,{crudCacheStrategy:{type:c.e.CACHE}}),(0,N.Sk)(void 0,{crudCacheStrategy:{type:c.e.CACHE}})],(0,i.jsx)(d.A,{description:U?(0,i.jsxs)(E.A,{flexDirection:"column",children:[(0,i.jsx)(O.sA,{id:"DEVICE_HARDWARE_ACCELERATION_DISABLED_BY"}),(0,i.jsxs)(u.A,{children:[k?(0,i.jsx)("li",{children:(0,i.jsx)(r.A,{variant:"inline",onClick:()=>{e((0,_.XP)({type:h.H.WAN,id:$?._id}))},...l.A.addDataTestId(l.A.TestId.SIDE_PANEL_TRIGGER),children:(0,i.jsx)(O.sA,{id:"COMMON_SMART_QUEUES"})})}):null,M?(0,i.jsx)("li",{children:(0,i.jsx)(C.A,{size:"inherit",to:`${w.E0}?${w.XU}=${b.K.QOS_RULES}`,children:(0,i.jsx)(O.sA,{id:"COMMON_QOS"})})}):null,D?(0,i.jsx)("li",{children:(0,i.jsx)(C.A,{size:"inherit",to:`${w.bB}/${w.Uy.TRAFFIC_LOGGING}`,children:(0,i.jsx)(O.sA,{id:"COMMON_NETFLOW"})})}):null,y?(0,i.jsx)("li",{children:(0,i.jsx)(C.A,{size:"inherit",to:`${w.E0}?${w.XU}=${b.K.NAT_RULES}`,children:(0,i.jsx)(O.sA,{id:"COMMON_IPV6_NAT"})})}):null]})]}):null,children:(0,i.jsx)("span",{children:(0,i.jsx)(v,{disabled:U})})}))},D=k(({dirty:e,isValid:t,values:n,setFormDirty:o,setFormInvalid:r,resetForm:l,formName:d="hardwareAcceleration"})=>{const c=(0,s.wA)();return(0,a.useEffect)(()=>(c((0,_.uo)({[d]:()=>n})),c((0,_.Oo)({[d]:()=>l({values:n})})),c((0,_.rW)({[d]:l})),()=>{c((0,_.uo)({[d]:null})),c((0,_.Oo)({[d]:null})),c((0,_.rW)({[d]:null}))}),[c,l,n,d]),(0,a.useEffect)(()=>{o(d,e),r(d,!t)},[o,e,r,t,d]),(0,i.jsx)(M,{})})},521376(e,t,n){var i;n.d(t,{U:()=>i}),function(e){e.ARROW_LEFT="ArrowLeft",e.ARROW_RIGHT="ArrowRight",e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape",e.BACKSPACE="Backspace",e.DELETE="Delete",e.TAB="Tab"}(i||(i={}))},478961(e,t,n){n.d(t,{A:()=>a});var i=n(274934),s=n(602086);const a=function(e){return t=>n=>{const[a,o]=(0,s.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[r,l]=(0,s.useState)(Object.fromEntries(e.map(e=>[e,!1]))),d=(0,s.useCallback)((e,t)=>{o(n=>({...n,[e]:t}))},[]),c=(0,s.useCallback)((e,t)=>{l(n=>({...n,[e]:t}))},[]),A=!!Object.values(a).find(e=>e),h=!!Object.values(r).find(e=>e);return(0,i.jsx)(t,{isDirty:A,isInvalid:h,formStates:a,setFormDirty:d,setFormInvalid:c,...n})}}}}]);