"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[46945,89965],{86571:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),l=n(217439),r=n(699784);const o=({id:e,children:t,values:n})=>a.createElement(l.A,{color:"text-1",weight:"bold",size:"medium"},e?a.createElement(r.sA,{id:e,values:n}):null,t)},137625:(e,t,n)=>{n.d(t,{A:()=>d});var a=n(296540),l=n(353899),r=n(132196),o=n(372737),i=n(566723),s=n(699784);const d=({children:e=null,title:t,titleValues:n,message:d,messageValues:c,handleConfirm:m=()=>null,handleClose:u=()=>null,handleCancel:E,isOpen:A,buttonVariant:g="primary",cancelButtonVariant:C="tertiary",cancelButtonMessage:h="COMMON_ACTION_CANCEL",buttonMessage:p="COMMON_ACTION_CONFIRM",buttonDisabled:O=!1,position:b="top",showHeaderClose:_=!1,contentClassName:S="",body:N,titleBody:f,className:R,rootClose:T=!1,footerActions:k})=>{const v=(0,a.useCallback)(e=>{A&&(e.stopPropagation(),e.key===o.U.ENTER?m():e.key===o.U.ESCAPE&&u(!1))},[A,m,u]);(0,a.useEffect)(()=>(window.addEventListener("keydown",v,!0),()=>{window.removeEventListener("keydown",v,!0)}),[v]);const w=(0,a.useCallback)(()=>{u(!1),E?.()},[u,E]),L=(0,a.useCallback)(()=>{u(!1),m()},[u,m]),I=(0,a.useMemo)(()=>[{text:a.createElement(s.sA,{id:h}),variant:C,onClick:w},{text:a.createElement(s.sA,{id:p}),disabled:O,variant:g,onClick:L}],[p,g,h,C,w,L,O]),$=(0,a.useCallback)(()=>{u(!1)},[u]),y=r.AH`
    ${t?"":`margin-top: ${i.xO}`}
  `;return a.createElement(l.A,{title:t?a.createElement(s.sA,{id:t,values:n}):f||null,...d?{body:a.createElement(a.Fragment,null,a.createElement(s.sA,{id:d,values:c}),N)}:{body:N},position:b,portal:!0,actions:k||I,showHeaderClose:_,contentClassName:r.AH`
        ${y}
        ${S}
      `,onRequestClose:$,isOpen:A,allowOverflow:!0,rootClose:T,className:R},e)}},152e3:(e,t,n)=>{n.d(t,{A:()=>u});var a=n(296540),l=n(436017),r=n(927099),o=n(314714),i=n(71479),s=n(566723),d=n(294303),c=n(699784);const m=(0,i.A)("div")`
  width: 100%;
  margin-bottom: ${s.Ln};
`,u={Toggle:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,noStyledRow:n})=>{const o=(0,a.useCallback)(({target:{checked:e}})=>{t(e)},[t]),i=a.createElement(l.A,{full:!0,checked:e,onChange:o},a.createElement(d.A,{width:"100%",alignItems:"center"},a.createElement(r.A,{size:"body"},a.createElement(c.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"}))));return n?i:a.createElement(m,null,i)},Checkbox:({isGlobalSwitchSettingsEnabled:e,setGlobalSwitchSettingsEnabled:t,onChange:n,noStyledRow:l})=>{const i=(0,a.useCallback)(({target:{checked:e}})=>{t(e),n?.(e)},[n,t]),s=a.createElement(o.A,{id:"global-switch-settings-checkbox",checked:e,onChange:i},a.createElement(d.A,{width:"100%",alignItems:"center"},a.createElement(r.A,{size:"body"},a.createElement(c.sA,{id:"COMMON_GLOBAL_SWITCH_SETTINGS"}))));return l?s:a.createElement(m,null,s)}}},334188:(e,t,n)=>{n.d(t,{A3:()=>c,Fw:()=>u,XH:()=>d,lp:()=>m});var a=n(801081),l=n(860631),r=n(302167),o=n(366188),i=n(776288),s=n(532419);const d=(0,a.Mz)(r.bL,o.a3,(e,t)=>e&&t.every(({wan_smartq_enabled:e})=>!e)),c=(0,a.Mz)(s.U$,e=>(0,l.$F)(e)),m=(0,a.Mz)(s.U$,e=>(0,l.$F)(e)&&(e.hardware_offload??!0)),u=(0,a.Mz)(s.U$,e=>(0,l.WM)(e.fw2_caps,i.A.HWOFFLOAD_QOS_AND_SMART_QUEUE))},363370:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),l=n(928085),r=n(876773);const o=e=>{const t=(0,l.A)(e.to);return a.createElement(r.A,{...e,to:t})}},372737:(e,t,n)=>{var a;n.d(t,{U:()=>a}),function(e){e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape"}(a||(a={}))},449688:(e,t,n)=>{n.d(t,{A:()=>l});var a=n(296540);const l=function(e){return t=>n=>{const[l,r]=(0,a.useState)(Object.fromEntries(e.map(e=>[e,!1]))),[o,i]=(0,a.useState)(Object.fromEntries(e.map(e=>[e,!1]))),s=(0,a.useCallback)((e,t)=>{r(n=>({...n,[e]:t}))},[]),d=(0,a.useCallback)((e,t)=>{i(n=>({...n,[e]:t}))},[]),c=!!Object.values(l).find(e=>e),m=!!Object.values(o).find(e=>e);return a.createElement(t,{isDirty:c,isInvalid:m,formStates:l,setFormDirty:s,setFormInvalid:d,...n})}}},470591:(e,t,n)=>{n.d(t,{A:()=>a});const a=(0,n(296540).createContext)({isStandalone:!0,header:[null,()=>{}],footer:[null,()=>{}]})},689965:(e,t,n)=>{n.d(t,{A:()=>E,I:()=>a});var a,l=n(296540),r=n(822336),o=n(427853),i=n(71479),s=n(825032),d=n(566723),c=n(294303);!function(e){e.ACCORDION="accordion",e.BUTTON_LIST="buttonList"}(a||(a={}));const m=(0,i.A)(c.A,{shouldForwardProp:e=>!["marginBottom","isButtonList","margin","flex","width","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-light`]};
  padding: ${({theme:e,isButtonList:t,padding:n})=>n||(t?`0 ${e.spacing["spacing-l"]}`:e.spacing["spacing-l"])};
  margin-bottom: ${({theme:e,marginBottom:t})=>t||e.spacing["spacing-l"]};
  ${({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  `:""}
`,u=(0,i.A)(o.A,{shouldForwardProp:e=>!["marginBottom","margin","flex","padding","nested","background"].includes(e)})`
  background-color: ${({background:e,nested:t,theme:{themeName:n}})=>e||r.Ay[n===s.S.DARK?`desktop-color-neutral-${t?"00":"01"}-dark`:`desktop-color-neutral-${t?"01":"00"}-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===s.S.DARK?"desktop-color-neutral-01-dark":"desktop-color-neutral-00-light"]};
      height: 48px;
      padding: 0 ${d.Ln};
    }
    > div:nth-child(2) {
      margin-bottom: 0;
      padding: 0 ${d.Ln} ${d.Ln};
      > div {
        padding: 0;
      }
    }
  }
`,E=({type:e,marginBottom:t,margin:n,padding:r,flex:o,width:i,nested:s,...d})=>"items"in d?l.createElement(u,{marginBottom:t,margin:n,padding:r,flex:o,nested:s,...d}):l.createElement(m,{nested:s,width:i,marginBottom:t,margin:n,padding:r,flex:o,isButtonList:e===a.BUTTON_LIST,...d},d.children)},691441:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(296540),l=n(470591);function r(e){const{children:t}=e,{isStandalone:n,footer:[,r]}=(0,a.useContext)(l.A);return(0,a.useLayoutEffect)(()=>{if(!n)return r(t),()=>r(null)},[n,t]),a.createElement(a.Fragment,null,n&&t)}},789367:(e,t,n)=>{var a;n.d(t,{K:()=>a}),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"}(a||(a={}))},795097:(e,t,n)=>{n.d(t,{A:()=>r});var a=n(71479),l=n(566723);const r=(0,a.A)("ul")`
  padding-left: ${l.Er};
  margin-bottom: 0;
  margin-top: 0;
`},876773:(e,t,n)=>{n.d(t,{A:()=>o});var a=n(296540),l=n(758649),r=n(196010);const o=e=>a.createElement(l.A,{component:r.A,variant:"inline",size:"medium",...e})},889764:(e,t,n)=>{n.d(t,{H5:()=>s,Lq:()=>i,n0:()=>o});var a=n(849513),l=n(276907),r=n(919952);const o=e=>e[r.U.SHARED][l.N.PROPERTY_PANEL]?.[a.Io.TAB_GET_DATA_FUNCTION]||{},i=e=>e[r.U.SHARED][l.N.PROPERTY_PANEL]?.[a.Io.TAB_SUBMIT_FUNCTION]||{},s=e=>e[r.U.SHARED][l.N.PROPERTY_PANEL]?.[a.Io.TAB_RESET_FUNCTION]||{}},896250:(e,t,n)=>{n.d(t,{A:()=>M});var a=n(469733),l=n(296540),r=n(951272),o=n(758649),i=n(718073),s=n(592510),d=n(582724),c=n(398300),m=n(795097),u=n(137625),E=n(143811),A=n(363370),g=n(294303),C=n(845030),h=n(699784),p=n(789367),O=n(302167),b=n(457311),_=n(138155),S=n(551735),N=n(366188),f=n(634229),R=n(583950),T=n(211817),k=n(20284),v=n(334188),w=n(959341);const L="hardware_offload",I=(0,r.bk)({enableReinitialize:!0,mapPropsToValues:({hardware_offload:e=!0})=>({[L]:e}),handleSubmit:(e,{resetForm:t})=>{t({values:e})}}),$=({disabled:e})=>{const[t,n]=(0,l.useState)(!1),{setFieldValue:a,values:o}=(0,r.j7)();return l.createElement(u.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),a(L,!1)},isOpen:t},l.createElement(E.A,{name:L,type:"realCheckbox",tooltipMessage:l.createElement(h.sA,{id:"DEVICE_HARDWARE_ACCELERATION_TOOLTIP"}),value:o[L],onChange:({target:{checked:e}})=>{e?a(L,!0):n(!0)},disabled:e},l.createElement(h.sA,{id:"COMMON_HARDWARE_ACCELERATION"})))},y=()=>{const e=(0,a.useDispatch)(),t=(0,a.useSelector)(N.a3),n=(0,a.useSelector)(O.Dd),r=(0,a.useSelector)(_.l),u=(0,a.useSelector)(v.Fw),E=(0,a.useSelector)(T.K2);(0,l.useEffect)(()=>{e((0,k.uL)(void 0,{crudCacheStrategy:{type:s.e.CACHE}}))},[e]);const L=(0,l.useMemo)(()=>t.find(({wan_smartq_enabled:e})=>e),[t]),I=!!L&&!u,y=r.length>0&&!u,M=n.enabled,D=(0,l.useMemo)(()=>E.some(e=>e.ip_version===R.hz.IPV6),[E]),U=I||y||M||D;return(0,d.A)([(0,S.X6)(void 0,{crudCacheStrategy:{type:s.e.CACHE}}),(0,b.Uc)(void 0,{crudCacheStrategy:{type:s.e.CACHE}}),(0,f.Sk)(void 0,{crudCacheStrategy:{type:s.e.CACHE}})],l.createElement(i.A,{description:U?l.createElement(g.A,{flexDirection:"column"},l.createElement(h.sA,{id:"DEVICE_HARDWARE_ACCELERATION_DISABLED_BY"}),l.createElement(m.A,null,I?l.createElement("li",null,l.createElement(o.A,{variant:"inline",onClick:()=>{e((0,C.XP)({type:c.H.WAN,id:L?._id}))}},l.createElement(h.sA,{id:"COMMON_SMART_QUEUES"}))):null,y?l.createElement("li",null,l.createElement(A.A,{size:"inherit",to:`${w.E0}?${w.XU}=${p.K.QOS_RULES}`},l.createElement(h.sA,{id:"COMMON_QOS"}))):null,M?l.createElement("li",null,l.createElement(A.A,{size:"inherit",to:`${w.bB}/${w.Uy.TRAFFIC_LOGGING}`},l.createElement(h.sA,{id:"COMMON_NETFLOW"}))):null,D?l.createElement("li",null,l.createElement(A.A,{size:"inherit",to:`${w.E0}?${w.XU}=${p.K.NAT_RULES}`},l.createElement(h.sA,{id:"COMMON_IPV6_NAT"}))):null)):null},l.createElement("span",null,l.createElement($,{disabled:U}))))},M=I(({dirty:e,isValid:t,values:n,setFormDirty:r,setFormInvalid:o,resetForm:i,formName:s="hardwareAcceleration"})=>{const d=(0,a.useDispatch)();return(0,l.useEffect)(()=>(d((0,C.uo)({[s]:()=>n})),d((0,C.Oo)({[s]:()=>i({values:n})})),d((0,C.rW)({[s]:i})),()=>{d((0,C.uo)({[s]:null})),d((0,C.Oo)({[s]:null})),d((0,C.rW)({[s]:null}))}),[d,i,n,s]),(0,l.useEffect)(()=>{r(s,e),o(s,!t)},[r,e,o,t,s]),l.createElement(y,null)})}}]);