"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[45461,67221],{267221(e,t,n){n.r(t),n.d(t,{default:()=>A});var i=n(274934),s=n(602086),a=n(938984),l=n(247816),o=n(977872),r=n(521376),d=n(869332),c=n(470070),C=n(384783);const u=(0,l.A)("div")`
  line-height: 1.5;
  word-break: break-word;
`,E=(0,l.A)(a.A)`
  color: ${({theme:{motifPalette:{text01:e}}})=>e} !important;
  padding-right: ${({theme:{spacing:e}})=>e["spacing-xl"]};
`,A=({message:e,title:t,onConfirm:n,children:l=null,messageValues:A={},size:m="small",titleValues:N={},onCancel:_=null,confirmButtonProps:I={},confirmButtonText:f,...k})=>{const O=(0,o.wA)(),w=(0,s.useCallback)(()=>{_?_():O((0,d.AS)())},[_,O]);return(0,s.useEffect)(()=>{function e(e){e.stopPropagation(),e.key===r.U.ENTER?n():e.key===r.U.ESCAPE&&w()}return window.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0)}},[w,n]),(0,i.jsxs)(C.A,{actions:[{text:(0,i.jsx)(c.sA,{id:"COMMON_ACTION_CANCEL"}),type:"button",onClick:w},{text:(0,i.jsx)(c.sA,{id:f??"COMMON_ACTION_CONFIRM"}),type:"button",variant:"primary",onClick:()=>n(),...I}],size:m,title:(0,i.jsx)(E,{size:"large",isTruncated:!0,children:(0,i.jsx)(c.sA,{id:t,values:N})}),...k,children:[(0,i.jsx)(u,{children:(0,i.jsx)(a.A,{size:"medium",children:(0,i.jsx)(c.sA,{id:e,values:A})})}),l]})}},945461(e,t,n){n.r(t),n.d(t,{default:()=>d});var i=n(274934),s=n(602086),a=n(977872),l=n(347625),o=n(869332),r=n(267221);const d=({onConfirm:e,onCancel:t,device:{disabled:n,name:d,model:c,mac:C}})=>{const u=(0,a.wA)(),E=(0,l.Q)({name:d,model:c,mac:C}),A=(0,s.useCallback)(()=>{e(),u((0,o.AS)())},[u,e]);return(0,i.jsx)(r.default,{onConfirm:A,title:n?"DEVICE_ACTIONS_ENABLE_CONFIRM_TITLE":"DEVICE_ACTIONS_DISABLE_CONFIRM_TITLE",titleValues:{deviceName:E},message:n?"DEVICE_ACTIONS_ENABLE_CONFIRM_MESSAGE":"DEVICE_ACTIONS_DISABLE_CONFIRM_MESSAGE",messageValues:{deviceName:E},onCancel:t})}}}]);