"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[66714],{137625:(e,t,r)=>{r.d(t,{A:()=>m});var l=r(296540),a=r(353899),n=r(132196),o=r(372737),i=r(566723),c=r(699784);const m=({children:e=null,title:t,titleValues:r,message:m,messageValues:E,handleConfirm:s=()=>null,handleClose:d=()=>null,handleCancel:u,isOpen:p,buttonVariant:_="primary",cancelButtonVariant:O="tertiary",cancelButtonMessage:C="COMMON_ACTION_CANCEL",buttonMessage:A="COMMON_ACTION_CONFIRM",buttonDisabled:I=!1,position:T="top",showHeaderClose:f=!1,contentClassName:k="",body:P,titleBody:S,className:R,rootClose:b=!1,footerActions:N})=>{const h=(0,l.useCallback)(e=>{p&&(e.stopPropagation(),e.key===o.U.ENTER?s():e.key===o.U.ESCAPE&&d(!1))},[p,s,d]);(0,l.useEffect)(()=>(window.addEventListener("keydown",h,!0),()=>{window.removeEventListener("keydown",h,!0)}),[h]);const v=(0,l.useCallback)(()=>{d(!1),u?.()},[d,u]),x=(0,l.useCallback)(()=>{d(!1),s()},[d,s]),g=(0,l.useMemo)(()=>[{text:l.createElement(c.sA,{id:C}),variant:O,onClick:v},{text:l.createElement(c.sA,{id:A}),disabled:I,variant:_,onClick:x}],[A,_,C,O,v,x,I]),L=(0,l.useCallback)(()=>{d(!1)},[d]),M=n.AH`
    ${t?"":`margin-top: ${i.xO}`}
  `;return l.createElement(a.A,{title:t?l.createElement(c.sA,{id:t,values:r}):S||null,...m?{body:l.createElement(l.Fragment,null,l.createElement(c.sA,{id:m,values:E}),P)}:{body:P},position:T,portal:!0,actions:N||g,showHeaderClose:f,contentClassName:n.AH`
        ${M}
        ${k}
      `,onRequestClose:L,isOpen:p,allowOverflow:!0,rootClose:b,className:R},e)}},266714:(e,t,r)=>{r.d(t,{A:()=>q});var l=r(469733),a=r(296540),n=r(927099),o=r(822336),i=r(718073),c=r(71479),m=r(132196),E=r(960407),s=r(398300),d=r(566723),u=r(855019),p=r(335165),_=r(548212),O=r(213601),C=r(137625),A=r(294303),I=r(955161),T=r(845030),f=r(699784),k=r(966784),P=r(538535),S=r(768941),R=r(366188),b=r(944373),N=r(792072),h=r(962669),v=r(431247),x=r(780811),g=r(376272),L=r(171073),M=r(777916),D=r(217439),w=r(705145),z=r(6510),y=r(854726),V=r(552020),$=r(532419);const W=(0,c.A)("div")`
  display: flex;
  justify-content: space-between;
  gap: ${d.YC};

  & > :last-child {
    max-width: 60%;
    text-align: right;
  }
`,U=(0,c.A)(A.A)`
  margin-bottom: ${d.kc};
  padding-bottom: ${d.kc};
  border-bottom: ${({theme:{themeName:e}})=>o.Ay[`desktop-border-divider-${e}`]};
`,H=(0,c.A)(w.A)`
  white-space: nowrap;
`,B=e=>a.createElement(H,{size:"small",...e}),F=({activeItem:e,activeItem:{downlink_table:t,model:r},portData:n,portData:{ifname:o,port_idx:i,portName:c,tx_bytes:m,rx_bytes:E,sfp_txfault:s,sfp_rxfault:u,sfp_vendor:p,sfp_serial:_,sfp_part:O,sfp_rev:C,sfp_compliance:I,sfp_voltage:T,sfp_current:k,sfp_txpower:P,sfp_rxpower:S,sfp_temperature:R},showPowerCycleHeader:b})=>{const{formatMessage:N}=(0,f.tz)(),x=(0,l.useSelector)(y.wD),g=(0,v.Hn)(n,x),L=(0,l.useSelector)($.ID),w=(0,h.Uz)(n.port_idx,e.mac,t,L),H=(0,h.RK)(n,e,L),F=n&&(0,v.d4)(n)&&n.sfp_found,Y=(0,h.xx)(n,N),X=(0,h.m3)(n,N),J=(0,V.Ki)(n),j=[];return F&&(s&&j.push(N({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_TX_FAULT"})),u&&j.push(N({id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_RX_FAULT"}))),a.createElement(A.A,{flexDirection:"column",minWidth:100},b?a.createElement(U,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_ACTIONS_PORT_CLICK_TO_POWER_CYCLE"}))):null,a.createElement(A.A,{gap:d.YC,flexDirection:"column"},n.masked||!i&&!o?null:a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_PORT"})),a.createElement(B,{motif:"dark"},(0,h.LS)(n,r))),c?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_NAME"})),a.createElement(B,{motif:"dark",isTruncated:!0},c)):null,Y?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_SPEED"})),a.createElement(B,{motif:"dark",isTruncated:!0},Y)):null,X||j.length>0?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_STATUS"})),a.createElement(B,{motif:"dark",isTruncated:!0},X,j.length>0?a.createElement(D.A,{color:"destructive"},j.join(", ")):null)):null,m&&m>0?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_TX"})),a.createElement(B,{motif:"dark"},a.createElement(M.A,{type:"bytes",input:m,motif:"dark"}))):null,E&&E>0?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_RX"})),a.createElement(B,{motif:"dark"},a.createElement(M.A,{type:"bytes",input:E,motif:"dark"}))):null,J?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_DEVICE_POE_MODE_POE"})),a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:J,values:{power:n.poe_power}}))):null,g?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PROFILE"})),a.createElement(B,{motif:"dark",isTruncated:!0},g)):null,w?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_DOWNLINK"})),a.createElement(B,{motif:"dark",isTruncated:!0},(0,z.Q)(w))):null,H?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_UPLINK"})),a.createElement(B,{motif:"dark",isTruncated:!0},(0,z.Q)(H))):null,F?a.createElement(a.Fragment,null,p?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_VENDOR"})),a.createElement(B,{motif:"dark"},String(p))):null,_?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_SERIAL"})),a.createElement(B,{motif:"dark"},String(_))):null,O?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_PART_NUMBER"})),a.createElement(B,{motif:"dark"},String(O))):null,C?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_REV"})),a.createElement(B,{motif:"dark"},String(C))):null,I?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_COMPLIANCE"})),a.createElement(B,{motif:"dark",isTruncated:!0},String(I))):null,T?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_VOLTAGE"})),a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_VOLTAGE",values:{voltage:Number(T||0).toFixed(2)}}))):null,k?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_CURRENT"})),a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_CURRENT",values:{current:+k}}))):null,R?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"COMMON_TEMPERATURE"})),a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTY_OVERVIEW_TEMPERATURE_VALUE",values:{temperature:Number(R).toFixed(1)}}))):null,Number(P)?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_OUTPUT_POWER"})),a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(P).toFixed(2)}}))):null,Number(S)?a.createElement(W,null,a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_LABEL_INPUT_POWER"})),a.createElement(B,{motif:"dark"},a.createElement(f.sA,{id:"DEVICE_PROPERTIES_SWITCH_TOOLTIP_VALUES_IO_POWER",values:{power:Number(S).toFixed(2)}}))):null):null))},Y=(0,c.A)(A.A,{shouldForwardProp:e=>!["colorInfo","portSize","portSizeOverride","isDisabled","centerIcon","hasTransparentBorder"].includes(e)})`
  height: ${({portSizeOverride:e,portSize:t})=>e||t?.size||p.J.large.size};
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||p.J.large.size};
  ${({portSize:e})=>e?.marginSize?`margin-left: ${e.marginSize}`:""};
  align-items: center;
  border-radius: 2px;
  justify-content: center;
  position: relative;
  pointer-events: auto;
  z-index: 3;

  ${({colorInfo:e,theme:{themeName:t}})=>e.background===g.A.DISABLED.background&&`border: ${(0,k.oX)(e.border,t)} 1px solid;`}
  background-color: ${({colorInfo:e,theme:{themeName:t}})=>(0,k.oX)(e.background,t)};
  color: ${({colorInfo:e,theme:{themeName:t}})=>(0,k.oX)(e.text,t)};

  /* Fix hover area of combo ports */
  ${({hasTransparentBorder:e})=>e&&"\n      position: relative;\n      &:before {\n        content: '';\n        position: absolute;\n        top: -3px;\n        right: -3px;\n        bottom: -3px;\n        left: -3px;   \n        background: transparent;\n        z-index: 2; \n      }\n  "}

  ${({centerIcon:e,portSize:t})=>e&&t?.spacing&&`transform: translateY(calc(50% + ${t?.spacing} / 2))`};
`,X=(0,c.A)("div",{shouldForwardProp:e=>!["portSize","portSizeOverride"].includes(e)})`
  width: ${({portSizeOverride:e,portSize:t})=>e||t?.size||p.J.large.size};
`,J=(0,c.A)("div",{shouldForwardProp:e=>!["size"].includes(e)})`
  position: absolute;
  width: calc(${p.J.large.size} + ${p.J.large.size} + 8px);
  height: calc(${p.J.large.size} + 4px);
  top: -2px;
  left: -2px;
  z-index: 1;
  background: ${({theme:{themeName:e}})=>o.Ay[`desktop-color-ublue-01-${e}`]};
  border-radius: ${d.YC};
  border: 1px solid ${({theme:{themeName:e}})=>o.Ay[`desktop-color-ublue-04-${e}`]};
`,j=(0,c.A)(A.A)`
  position: relative;
  cursor: pointer;
`,G=m.AH`
  [data-uic-component='Tooltip.Arrow'] {
    pointer-events: none;
  }
`,K=({cellData:e,activeItem:t,activeItem:{mac:r,name:o,model:c},keyValue:m,portSize:d,portSizeOverride:p,disableOnPortClick:A=!1,centerIcon:g,tooltipPlacement:M="bottom"})=>{const D=(0,l.useDispatch)(),w=(0,l.useSelector)(b.D),z=(0,l.useSelector)(E.oI),y=(0,l.useSelector)(P.D5),V=e||{},$=(0,l.useSelector)(R.wf),W=(0,l.useSelector)(N.pB),U=(0,k.vT)(V,t,w,y,$,W,[]),[H,B]=(0,a.useState)(!1),X=(0,a.useCallback)(()=>{D((0,L.Fx)({mac:r,name:o},e.port_idx)),B(!1)},[r,o,e.port_idx,D]),K=e.poe_enable&&!(0,x.ioy)(t);return a.createElement(I.A,{condition:K,wrapper:t=>a.createElement(C.A,{title:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_TITLE",titleValues:{portId:e.port_idx},buttonMessage:"COMMON_ACTION_PROCEED",handleClose:B,handleConfirm:X,isOpen:H,rootClose:!0,body:a.createElement(n.A,{size:"inherit"},a.createElement(f.sA,{id:"DEVICE_PORT_POWER_CYCLE_CONFIRMATION_BODY",values:{portId:e.port_idx}}))},t)},a.createElement(i.A,{description:a.createElement(F,{activeItem:t,portData:V,showPowerCycleHeader:K}),delay:0,closeDelay:0,isDisabled:H,key:m,placement:M,className:G},a.createElement(j,{onClick:l=>K?(B(!0),null):A||e.masked?null:(l?.preventDefault?.(),l?.stopPropagation?.(),(0,x.Cyy)(t)||(0,x.oWO)(t)?D((0,T.XP)({type:s.H.DEVICE,id:r,tab:z,subPanel:u.uY.PORTS,subId:V?.ifname})):D("wan"===V?.network_name||"wan2"===V?.network_name?(0,T.XP)({type:s.H.DEVICE,id:r,tab:z,subPanel:u.uY.PORTS,subId:u.uj.WAN}):V?.dns?(0,T.XP)({type:s.H.DEVICE,id:r,tab:z,subPanel:u.uY.PORTS,subId:u.uj.ALL}):(0,T.XP)({type:s.H.DEVICE,id:r,tab:z,subPanel:u.uY.PORTS,subId:V.op_mode===S.RC.AGGREGATE?V.portIdx||V.port_idx||V.ifname:(0,h.Cu)(V)})))},a.createElement(Y,{centerIcon:g,colorInfo:(0,_.PI)(U),portSize:d,portSizeOverride:p,hasTransparentBorder:(0,v.mx)(e.port_idx,c)},a.createElement(O.A,{icon:U.icon,smallerIcons:!0})),(0,v.vu)(e.port_idx,c)?a.createElement(J,null):null)))},q=({cellData:e,activeItem:t,keyValue:r,portSize:l,portSizeOverride:n,...o})=>e?a.createElement(K,{cellData:e,activeItem:t,keyValue:r,portSize:l,portSizeOverride:n,...o}):(0,x.ez9)(t)||(0,x.iHo)(t)||(0,x.Lqw)(t)||(0,x.ocB)(t)?null:a.createElement(X,{key:r,portSize:l,portSizeOverride:n})},335165:(e,t,r)=>{r.d(t,{J:()=>a});var l=r(566723);const a={large:{threshold:12,size:"24px",spacing:l.YC},medium:{threshold:15,size:"16px",spacing:l.YC},small:{threshold:20,size:"12px",spacing:l.YC},xsmall:{threshold:50,size:"11px",spacing:"1px"}}},372737:(e,t,r)=>{var l;r.d(t,{U:()=>l}),function(e){e.ARROW_DOWN="ArrowDown",e.ARROW_UP="ArrowUp",e.ENTER="Enter",e.ESCAPE="Escape"}(l||(l={}))}}]);