"use strict";(self.webpackChunkname=self.webpackChunkname||[]).push([[53],{79369:(e,t,n)=>{var r=n(64836);t.Z=void 0;var a=r(n(64938)),o=n(85893),i=(0,a.default)((0,o.jsx)("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz");t.Z=i},66489:(e,t,n)=>{n.d(t,{Z:()=>k});var r=n(63366),a=n(87462),o=n(81672),i=n(86010),c=n(94780),l=n(70917),s=n(98216),u=n(71657),d=n(90948),m=n(22346),f=n(85893);const p=["className","color","disableShrink","size","style","thickness","value","variant"];let b,y,v,g,h=e=>e;const Z=(0,l.F4)(b||(b=h`
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
`)),R=(0,l.F4)(y||(y=h`
  0% {
    stroke-dasharray: 1px, 200px;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 100px, 200px;
    stroke-dashoffset: -15px;
  }

  100% {
    stroke-dasharray: 100px, 200px;
    stroke-dashoffset: -125px;
  }
`)),S=(0,d.ZP)("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${(0,s.Z)(n.color)}`]]}})((({ownerState:e,theme:t})=>(0,a.Z)({display:"inline-block"},"determinate"===e.variant&&{transition:t.transitions.create("transform")},"inherit"!==e.color&&{color:(t.vars||t).palette[e.color].main})),(({ownerState:e})=>"indeterminate"===e.variant&&(0,l.iv)(v||(v=h`
      animation: ${0} 1.4s linear infinite;
    `),Z))),C=(0,d.ZP)("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),E=(0,d.ZP)("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${(0,s.Z)(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})((({ownerState:e,theme:t})=>(0,a.Z)({stroke:"currentColor"},"determinate"===e.variant&&{transition:t.transitions.create("stroke-dashoffset")},"indeterminate"===e.variant&&{strokeDasharray:"80px, 200px",strokeDashoffset:0})),(({ownerState:e})=>"indeterminate"===e.variant&&!e.disableShrink&&(0,l.iv)(g||(g=h`
      animation: ${0} 1.4s ease-in-out infinite;
    `),R))),k=o.forwardRef((function(e,t){const n=(0,u.Z)({props:e,name:"MuiCircularProgress"}),{className:o,color:l="primary",disableShrink:d=!1,size:b=40,style:y,thickness:v=3.6,value:g=0,variant:h="indeterminate"}=n,Z=(0,r.Z)(n,p),R=(0,a.Z)({},n,{color:l,disableShrink:d,size:b,thickness:v,value:g,variant:h}),k=(e=>{const{classes:t,variant:n,color:r,disableShrink:a}=e,o={root:["root",n,`color${(0,s.Z)(r)}`],svg:["svg"],circle:["circle",`circle${(0,s.Z)(n)}`,a&&"circleDisableShrink"]};return(0,c.Z)(o,m.C,t)})(R),w={},O={},P={};if("determinate"===h){const e=2*Math.PI*((44-v)/2);w.strokeDasharray=e.toFixed(3),P["aria-valuenow"]=Math.round(g),w.strokeDashoffset=`${((100-g)/100*e).toFixed(3)}px`,O.transform="rotate(-90deg)"}return(0,f.jsx)(S,(0,a.Z)({className:(0,i.Z)(k.root,o),style:(0,a.Z)({width:b,height:b},O,y),ownerState:R,ref:t,role:"progressbar"},P,Z,{children:(0,f.jsx)(C,{className:k.svg,ownerState:R,viewBox:"22 22 44 44",children:(0,f.jsx)(E,{className:k.circle,style:w,ownerState:R,cx:44,cy:44,r:(44-v)/2,fill:"none",strokeWidth:v})})}))}))},22346:(e,t,n)=>{n.d(t,{C:()=>o,Z:()=>i});var r=n(1588),a=n(34867);function o(e){return(0,a.Z)("MuiCircularProgress",e)}const i=(0,r.Z)("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"])},37645:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(87462),a=n(63366),o=n(81672),i=n(86010),c=n(94780),l=n(23972),s=n(90948),u=n(71657),d=n(4472),m=n(34182),f=n(85893);const p=["className","id"],b=(0,s.ZP)(l.Z,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),y=o.forwardRef((function(e,t){const n=(0,u.Z)({props:e,name:"MuiDialogTitle"}),{className:l,id:s}=n,y=(0,a.Z)(n,p),v=n,g=(e=>{const{classes:t}=e;return(0,c.Z)({root:["root"]},d.a,t)})(v),{titleId:h=s}=o.useContext(m.Z);return(0,f.jsx)(b,(0,r.Z)({component:"h2",className:(0,i.Z)(g.root,l),ownerState:v,ref:t,variant:"h6",id:null!=s?s:h},y))}))},17075:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(63366),a=n(87462),o=n(81672),i=n(86010),c=n(94780),l=n(90948),s=n(71657),u=n(98216),d=n(83096),m=n(85893);const f=["className","color","component","disableGutters","disableSticky","inset"],p=(0,l.ZP)("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"default"!==n.color&&t[`color${(0,u.Z)(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})((({theme:e,ownerState:t})=>(0,a.Z)({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},"primary"===t.color&&{color:(e.vars||e).palette.primary.main},"inherit"===t.color&&{color:"inherit"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.inset&&{paddingLeft:72},!t.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}))),b=o.forwardRef((function(e,t){const n=(0,s.Z)({props:e,name:"MuiListSubheader"}),{className:o,color:l="default",component:b="li",disableGutters:y=!1,disableSticky:v=!1,inset:g=!1}=n,h=(0,r.Z)(n,f),Z=(0,a.Z)({},n,{color:l,component:b,disableGutters:y,disableSticky:v,inset:g}),R=(e=>{const{classes:t,color:n,disableGutters:r,inset:a,disableSticky:o}=e,i={root:["root","default"!==n&&`color${(0,u.Z)(n)}`,!r&&"gutters",a&&"inset",!o&&"sticky"]};return(0,c.Z)(i,d.s,t)})(Z);return(0,m.jsx)(p,(0,a.Z)({as:b,className:(0,i.Z)(R.root,o),ref:t,ownerState:Z},h))}));b.muiSkipListHighlight=!0;const y=b},83096:(e,t,n)=>{n.d(t,{Z:()=>i,s:()=>o});var r=n(1588),a=n(34867);function o(e){return(0,a.Z)("MuiListSubheader",e)}const i=(0,r.Z)("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"])},28748:(e,t,n)=>{n.d(t,{Z:()=>m});var r=n(33206),a=n(64666),o=n(37645),i=n(35713),c=n(91894),l=n(69397),s=n(66489);function u(){return u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u.apply(this,arguments)}var d=(0,r.ZL)()((function(e,t){return{dialogContent:{width:t.contentWidth}}}));const m=function(e){var t=e.open,n=e.onClose,r=e.onCancel,m=e.onConfirm,f=e.labelTitle,p=void 0===f?"Are you sure?":f,b=e.labelCancel,y=void 0===b?"Cancel":b,v=e.labelConfirm,g=void 0===v?"Confirm":v,h=e.children,Z=e.contentWidth,R=e.confirmDisabled,S=void 0!==R&&R,C=e.cancelDisabled,E=void 0!==C&&C,k=e.submitting,w=void 0!==k&&k,O=e.dialogPaperClassName,P=e.dialogTitleClassName,A=e.dialogContentClassName,j=e.dialogActionsClassName,T=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["open","onClose","onCancel","onConfirm","labelTitle","labelCancel","labelConfirm","children","contentWidth","confirmDisabled","cancelDisabled","submitting","dialogPaperClassName","dialogTitleClassName","dialogContentClassName","dialogActionsClassName"]),x=d({contentWidth:Z}),D=x.classes,I=x.cx;return React.createElement(a.Z,u({PaperProps:{className:O},open:t,scroll:"paper",onClose:n},T),p&&React.createElement(o.Z,{className:P},p),h&&React.createElement(i.Z,{className:I(D.dialogContent,A)},h),React.createElement(c.Z,{className:j},r&&React.createElement(l.Z,{color:"primary",disabled:E,onClick:r},y),React.createElement(l.Z,{"aria-label":g,color:"primary",disabled:S,endIcon:w&&React.createElement(s.Z,{size:15}),onClick:m},g)))}},4253:(e,t,n)=>{n.d(t,{Z:()=>v});var r=n(79895),a=n(33206),o=n(53640),i=n(60076),c=n(43106),l=n(17075),s=n(67720),u=n(63931),d=n(74509),m=n(89059);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(){return p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(this,arguments)}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}var y=(0,a.ZL)()((function(e){return{compact:{fontSize:"x-small",padding:e.spacing(.75)},input:{fontSize:e.typography.body1.fontSize},noLabelInput:{padding:e.spacing(1)}}}));const v=function(e){var t,n=e.dataTestId,a=e.options,v=e.onChange,g=e.selectedOptionId,h=e.label,Z=e.error,R=e.fullWidth,S=e.ariaLabel,C=e.inputProps,E=e.compact,k=void 0!==E&&E,w=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,["dataTestId","options","onChange","selectedOptionId","label","error","fullWidth","ariaLabel","inputProps","compact"]),O=y(),P=O.classes,A=O.cx;return React.createElement(o.Z,{error:!(0,r.kKJ)(Z),fullWidth:R,size:"small"},h&&React.createElement(i.Z,null,h),React.createElement(c.Z,p({disableUnderline:!0,displayEmpty:!0,fullWidth:R,inputProps:b({"aria-label":S,className:A(P.input,(t={},f(t,P.noLabelInput,!h&&!k),f(t,P.compact,k),t)),"data-testid":n},C),label:h,renderValue:function(e){var t;return null===(t=function(e){return a.find((0,r.OH4)("id",e))}(e))||void 0===t?void 0:t.name},value:g,onChange:function(e){(0,r.kKJ)(e.target.value)||v(e)}},w),a.filter((function(e){return""!==e.id})).map((function(e){var t=e.id,n=e.name,r=e.color,a=e.type,o=e.testId,i="".concat(t,"-").concat(n);return"header"===a?[React.createElement(l.Z,{key:i},n),React.createElement(s.Z,{key:"".concat(i,"-divider")})]:React.createElement(u.Z,{"data-testid":o,key:i,style:{backgroundColor:r},value:t},React.createElement(m.Z,null,n))}))),Z&&React.createElement(d.Z,null,Z))}},50053:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Oe});var r=n(81672),a=n(79895),o=n(63397),i=n(80620),c=n(16779),l=n(15398),s=n(51334),u=n(79369),d=n(10971),m=n(97466),f=n(71426),p=n(99151),b=n(54342),y=n(43412),v=n(58837),g=n(75111),h=n(83584),Z=n(51968),R=n(50975),S=n(41054),C=n(27484),E=n.n(C),k=n(8934),w=n(58226),O=n(25979),P=n(72856),A=n(32899),j=n(42588),T=n(59708),x=n(74509),D=n(20847),I=n(35681);const _=(0,n(61354).Z)();var M=n(70961),N=n(28748),z=n(4253),K=n(61417);function L(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function W(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){W(e,t,n[t])}))}return e}var q=new Date("2100-01-01"),V=function(e){return function(){return React.createElement("div",null,null==e?void 0:e.endAdornment)}},F=function(e){return function(t){var n,r,a=t.inputRef,o=t.inputProps,i=t.InputProps;return React.createElement(M.Z,{EndAdornment:V(i),inputProps:(n=$({},o),r={"aria-label":e,ref:a,style:{padding:8}},r=null!=r?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})),n)})}};const J=function(e){var t,n,c,l=e.resources,s=e.canConfirm,u=e.onCancel,d=e.onConfirm,m=e.errors,f=e.values,p=e.submitting,b=e.handleChange,v=e.setFieldValue,g=(0,o.useTranslation)().t,h=(0,R.Z)(),Z=h.getDowntimeDeniedTypeAlert,S=h.canDowntimeServices,C=(n=(0,r.useState)(!1),c=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(n,c)||function(e,t){if(e){if("string"==typeof e)return L(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}(n,c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),k=C[0],w=C[1],W=(0,i.useAtomValue)(O.userAtom).locale,$=(0,K.Z)(),V=$.Adapter,J=$.getDestinationAndConfiguredTimezoneOffset,G=$.formatKeyboardValue,H=l.length>0,B=l.find((function(e){return"host"===e.type})),U=Z(l),Y=function(e){return function(t,n){var r=k?E()(t).toDate():E()(G(n)).add(E().duration({hours:J()})).toDate();!function(e){return function(t){v(e,t)}}(e)(r)}};return React.createElement(N.Z,{confirmDisabled:!s,labelCancel:g(y.SsP),labelConfirm:g(y.eRi),labelTitle:g(y.tJS),open:H,submitting:p,onCancel:u,onClose:u,onConfirm:d},React.createElement(P._,{dateAdapter:V,locale:W.substring(0,2)},U&&React.createElement(j.Z,{severity:"warning"},U),React.createElement(T.Z,{spacing:2},React.createElement(_,{alignItems:"center",display:"grid",gap:1,gridTemplateColumns:"1fr auto 1fr"},React.createElement(A.x,{disableMaskedInput:!0,maxDate:E()(q),renderInput:F(g(y.CBo)),value:f.startTime,onChange:Y("startTime"),onClose:function(){return w(!1)},onOpen:function(){return w(!0)}}),React.createElement(x.Z,null,g(y.m$J)),React.createElement(A.x,{disableMaskedInput:!0,renderInput:F(g(y.VYk)),value:f.endTime,onChange:Y("endTime"),onClose:function(){return w(!1)},onOpen:function(){return w(!0)}}),(0,a.kKJ)(null==m?void 0:m.startTime)?React.createElement("div",null):React.createElement(x.Z,{error:!0},null==m?void 0:m.startTime),React.createElement("div",null),(0,a.kKJ)(null==m?void 0:m.endTime)?React.createElement("div",null):React.createElement(x.Z,{error:!0},null==m?void 0:m.endTime)),React.createElement(T.Z,null,React.createElement(x.Z,null,g(y.y8B)),React.createElement(T.Z,{alignItems:"center",direction:"row",spacing:1},React.createElement(M.Z,{ariaLabel:g(y.y8B),disabled:f.fixed,error:null==m||null===(t=m.duration)||void 0===t?void 0:t.value,type:"number",value:f.duration.value,onChange:b("duration.value")}),React.createElement(z.Z,{disabled:f.fixed,options:[{id:"seconds",name:g(y.hXL)},{id:"minutes",name:g(y.ODc)},{id:"hours",name:g(y.pez)}],selectedOptionId:f.duration.unit,onChange:b("duration.unit")}),React.createElement(D.Z,{control:React.createElement(I.Z,{checked:f.fixed,color:"primary",inputProps:{"aria-label":g(y.bg7)},size:"small",onChange:b("fixed")}),label:g(y.bg7)}))),React.createElement(M.Z,{fullWidth:!0,multiline:!0,error:null==m?void 0:m.comment,label:g(y.Nue),rows:3,value:f.comment,onChange:b("comment")}),B&&React.createElement(D.Z,{control:React.createElement(I.Z,{checked:S()&&f.isDowntimeWithServices,color:"primary",disabled:!S(),inputProps:{"aria-label":y.LGV},size:"small",onChange:b("isDowntimeWithServices")}),label:g(y.LGV)}))))};var G=n(19501),H=function(e){var t=G.hT().typeError(e(y.kd7)).required(e(y.KeO)).nullable();return G.Ry().shape({comment:G.Z_().required(e(y.KeO)),duration:G.Ry().when("fixed",(function(t,n){return t?n:n.shape({unit:G.Z_().required(e(y.KeO)),value:G.Z_().required(e(y.KeO))})})),endTime:t.when("startTime",(function(n){return(0,a.kKJ)(n)||!E()(n).isValid()?t:t.min(E()(n).add(E().duration({minutes:1})),e(y.aWv)).max(E()(n).add(E().duration({years:1})),e(y.S18))})),fixed:G.O7(),startTime:t})};function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){B(e,t,n[t])}))}return e}const Y=function(e){var t=e.resources,n=e.onClose,a=e.onSuccess,c=(0,o.useTranslation)().t,l=(0,m.Z)().showSuccessMessage,s=(0,k.ZP)().toIsoString,u=(0,w.Z)({request:v.Yy}),d=u.sendRequest,f=u.sending,p=(0,i.useAtomValue)(O.userAtom).alias,b=(0,i.useAtomValue)(O.downtimeAtom),g=new Date,h=E()(g).add(E().duration({seconds:b.duration})).toDate(),Z=(0,S.TA)({initialValues:{comment:void 0,duration:{unit:"seconds",value:b.duration},endTime:h,fixed:b.fixed,isDowntimeWithServices:b.with_services,startTime:g},onSubmit:function(e,n){(0,n.setSubmitting)(!0);var r,o,i=e.startTime,u=e.endTime,m={hours:3600,minutes:60,seconds:1},f=(null==m?void 0:m[e.duration.unit])||1,p=e.duration.value*f;d({params:(r=U({},e),o={duration:p,endTime:s(u),startTime:s(i)},o=null!=o?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})),r),resources:t}).then((function(){l(c(y.vP8)),a()}))},validationSchema:H(c)});return(0,r.useEffect)((function(){Z.setFieldValue("comment","".concat(c(y.opf)," ").concat(p))}),[]),React.createElement(J,{canConfirm:Z.isValid,errors:Z.errors,handleChange:Z.handleChange,resources:t,setFieldValue:Z.setFieldValue,submitting:f,values:Z.values,onCancel:n,onConfirm:Z.submitForm})};var X=n(16651),Q=(0,c.Z)((function(e){return{notify:{marginBottom:e.spacing(2)}}}));const ee=function(e){var t=e.resources,n=e.canConfirm,r=e.onCancel,a=e.onConfirm,i=e.errors,c=e.values,l=e.submitting,s=e.handleChange,u=Q(),d=(0,o.useTranslation)().t,m=(0,R.Z)(),f=m.getAcknowledgementDeniedTypeAlert,p=m.canAcknowledgeServices,b=f(t),v=t.length>0,g=t.find((function(e){return"host"===e.type}));return React.createElement(N.Z,{confirmDisabled:!n,labelCancel:d(y.SsP),labelConfirm:d(y.KE_),labelTitle:d(y.KE_),open:v,submitting:l,onCancel:r,onClose:r,onConfirm:a},React.createElement(X.ZP,{container:!0,direction:"column"},b&&React.createElement(X.ZP,{item:!0},React.createElement(j.Z,{severity:"warning"},b)),React.createElement(X.ZP,{item:!0},React.createElement(M.Z,{fullWidth:!0,multiline:!0,error:null==i?void 0:i.comment,label:d(y.Nue),rows:3,value:c.comment,onChange:s("comment")})),React.createElement(X.ZP,{container:!0,item:!0,className:u.notify},React.createElement(X.ZP,{item:!0},React.createElement(D.Z,{control:React.createElement(I.Z,{checked:c.notify,color:"primary",inputProps:{"aria-label":d(y.TqG)},size:"small",onChange:s("notify")}),label:d(y.TqG)})),React.createElement(X.ZP,{container:!0,item:!0,rowSpacing:1},React.createElement(x.Z,null,d(y.bt2)))),React.createElement(X.ZP,{item:!0},React.createElement(D.Z,{control:React.createElement(I.Z,{checked:c.isSticky,color:"primary",inputProps:{"aria-label":d(y.F9L)},size:"small",onChange:s("isSticky")}),label:d(y.F9L)})),React.createElement(X.ZP,{item:!0},React.createElement(D.Z,{control:React.createElement(I.Z,{checked:c.persistent,color:"primary",inputProps:{"aria-label":d(y.$55)},size:"small",onChange:s("persistent")}),label:d(y.$55)})),g&&React.createElement(X.ZP,{item:!0},React.createElement(D.Z,{control:React.createElement(I.Z,{checked:p()&&c.acknowledgeAttachedResources,color:"primary",disabled:!p(),inputProps:{"aria-label":d(y.JP_)},size:"small",onChange:s("acknowledgeAttachedResources")}),label:d(y.JP_)}))))};var te=G.Ry().shape({comment:G.Z_().required(y.KeO),force_active_checks:G.O7(),is_sticky:G.O7(),notify:G.O7(),persistent:G.O7()});const ne=function(e){var t=e.resources,n=e.onClose,a=e.onSuccess,c=(0,o.useTranslation)().t,l=(0,m.Z)().showSuccessMessage,s=(0,w.Z)({request:v.Xt}),u=s.sendRequest,d=s.sending,f=(0,i.useAtomValue)(O.userAtom).alias,p=(0,i.useAtomValue)(O.acknowledgementAtom),b=(0,S.TA)({initialValues:{acknowledgeAttachedResources:p.with_services,comment:void 0,forceActiveChecks:p.force_active_checks,isSticky:p.sticky,notify:p.notify,persistent:p.persistent},onSubmit:function(e){u({params:e,resources:t}).then((function(){l(c(y.LSs)),a()}))},validationSchema:te});return(0,r.useEffect)((function(){b.setFieldValue("comment","".concat(c(y.qsM)," ").concat(f))}),[]),React.createElement(ee,{canConfirm:b.isValid,errors:b.errors,handleChange:b.handleChange,resources:t,submitting:d,values:b.values,onCancel:n,onConfirm:b.submitForm})};var re=n(71257),ae=n(63019),oe="".concat(ae.cK,"/acknowledgements"),ie=function(e){return function(t){var n=t.resources,r=t.disacknowledgeAttachedResources,o=n.map((function(e){var t=e.type,n=e.id,r=e.parent,o=e.service_id;return{id:(0,a.fS0)(t,g._g.anomalydetection)?o:n,parent:r?{id:null==r?void 0:r.id}:null,type:g.s6[t]}}));return re.Z.delete(oe,{cancelToken:e,data:{disacknowledgement:{with_services:r},resources:o}})}};function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const le=function(e){var t,n,i=e.resources,c=e.onClose,l=e.onSuccess,s=(0,o.useTranslation)().t,u=(0,m.Z)().showSuccessMessage,d=(t=(0,r.useState)(!0),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(t,n)||function(e,t){if(e){if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),f=d[0],p=d[1],b=(0,w.Z)({request:ie}),v=b.sendRequest,g=b.sending,h=(0,R.Z)(),Z=h.getDisacknowledgementDeniedTypeAlert,S=h.canDisacknowledgeServices,C=Z(i);(0,r.useEffect)((function(){S()||p(!1)}),[]);var E=i.find((0,a.OH4)("type","host"));return React.createElement(N.Z,{open:!0,confirmDisabled:g,labelCancel:s(y.SsP),labelConfirm:s(y.sbi),labelTitle:s(y.sbi),submitting:g,onCancel:c,onClose:c,onConfirm:function(){v({disacknowledgeAttachedResources:f,resources:i}).then((function(){u(s(y.mrg)),l()}))}},React.createElement(X.ZP,{container:!0,direction:"column",spacing:1},C&&React.createElement(X.ZP,{item:!0},React.createElement(j.Z,{severity:"warning"},C)),E&&React.createElement(X.ZP,{item:!0},React.createElement(D.Z,{control:React.createElement(I.Z,{checked:S()&&f,color:"primary",disabled:!S(),inputProps:{"aria-label":s(y.occ)},size:"small",onChange:function(e){p(Boolean(e.target.checked))}}),label:s(y.occ)}))))};var se="".concat(ae.cK,"/submit"),ue=function(e){return function(t){var n=t.resource,r=t.statusId,o=t.output,i=t.performanceData;return re.Z.post(se,{resources:[{id:(0,a.fS0)(n.type,g._g.anomalydetection)?n.service_id:n.id,output:o,parent:(null==n?void 0:n.parent)?{id:n.parent.id}:null,performance_data:i,status:r,type:g.s6[n.type]}]},{cancelToken:e})}};function de(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return de(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?de(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const fe=function(e){var t=e.resource,n=e.onClose,a=e.onSuccess,i=(0,o.useTranslation)().t,c=(0,m.Z)().showSuccessMessage,l=me((0,r.useState)(0),2),s=l[0],u=l[1],d=me((0,r.useState)(""),2),f=d[0],p=d[1],b=me((0,r.useState)(""),2),v=b[0],g=b[1],h=[{id:0,name:i(y.uDl)},{id:1,name:i(y.g_G)},{id:2,name:i(y.L1X)},{id:3,name:i(y.z72)}],Z={host:[{id:0,name:i(y.eML)},{id:1,name:i(y.$M$)},{id:2,name:i(y.$A_)}],metaservice:h,service:h},R=(0,w.Z)({request:ue}),S=R.sendRequest,C=R.sending;return React.createElement(N.Z,{open:!0,confirmDisabled:C,labelCancel:i(y.SsP),labelConfirm:i(y.co1),labelTitle:i(y.HKz),submitting:C,onCancel:n,onClose:n,onConfirm:function(){S({output:f,performanceData:v,resource:t,statusId:s}).then((function(){c(i(y.z13)),a()}))}},React.createElement(X.ZP,{container:!0,direction:"column",spacing:1,style:{minWidth:500}},React.createElement(X.ZP,{item:!0},React.createElement(z.Z,{fullWidth:!0,label:i(y.DnW),options:Z[t.type],selectedOptionId:s,onChange:function(e){u(e.target.value)}})),React.createElement(X.ZP,{item:!0},React.createElement(M.Z,{fullWidth:!0,ariaLabel:i(y._H1),label:i(y._H1),value:f,onChange:function(e){p(e.target.value)}})),React.createElement(X.ZP,{item:!0},React.createElement(M.Z,{fullWidth:!0,ariaLabel:i(y.d72),label:i(y.d72),value:v,onChange:function(e){g(e.target.value)}}))))};var pe=n(2734),be=n(98396),ye=n(21023),ve=n(21669),ge=n(69397);function he(){return he=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},he.apply(this,arguments)}const Ze=function(e){return React.createElement(ge.Z,he({color:"primary",size:"small"},e))},Re=function(e){var t=e.icon,n=e.label,r=e.onClick,a=e.disabled,i=e.testId,c=e.permitted,l=void 0===c||c,s=(0,pe.Z)(),u=(0,o.useTranslation)().t,d=Boolean((0,be.Z)(s.breakpoints.down(1100))),m=l?n:"".concat(n," (").concat(u(y.x6i),")");return d?React.createElement(ve.Z,{ariaLabel:u(n),"data-testid":i,disabled:a,size:"large",title:m,onClick:r},t):React.createElement(ye.Z,{title:l?"":y.x6i},React.createElement("span",null,React.createElement(Ze,{"aria-label":u(n),"data-testid":i,disabled:a,startIcon:t,variant:"contained",onClick:r},n)))};var Se=n(63931);const Ce=function(e){var t=e.permitted,n=e.label,r=e.onClick,a=e.testId,i=e.disabled,c=(0,o.useTranslation)().t,l=t?"":c(y.x6i);return React.createElement(ye.Z,{title:l},React.createElement("div",null,React.createElement(Se.Z,{"data-testid":a,disabled:i,onClick:r},c(n))))};function Ee(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ee(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ee(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var we=(0,c.Z)((function(e){return{action:{marginRight:e.spacing(1)},flex:{alignItems:"center",display:"flex"}}}));const Oe=function(){var e,t=we(),n=(0,o.useTranslation)().t,c=(0,d.Z)(),S=c.cancel,C=c.token,E=(0,m.Z)(),k=E.showErrorMessage,w=E.showSuccessMessage,O=ke((0,r.useState)(),2),P=O[0],A=O[1],j=ke((0,r.useState)(),2),T=j[0],x=j[1],D=ke((0,i.useAtom)(Z.aN),2),I=D[0],_=D[1],M=ke((0,i.useAtom)(Z.jA),2),N=M[0],z=M[1],K=ke((0,i.useAtom)(Z.q$),2),L=K[0],W=K[1],$=ke((0,i.useAtom)(Z.ZN),2),q=$[0],V=$[1],F=ke((0,i.useAtom)(Z.dq),2),J=F[0],G=F[1],H=(0,R.Z)(),B=H.canAcknowledge,U=H.canDowntime,X=H.canCheck,Q=H.canDisacknowledge,ee=H.canSubmitStatus,te=H.canComment,re=q.length>0,ae=function(){_([]),z([]),W([]),V([]),A(null),G([]),x(null)};(0,r.useEffect)((function(){re&&(0,v.Pt)({cancelToken:C,resources:q}).then((function(){ae(),w(n(y.X20))})).catch((function(){return k(n(y.KPL))}))}),[q]),(0,r.useEffect)((function(){return function(){return S()}}),[]);var oe=(0,a.$6P)((0,a.uF6)(["status","severity_code"],f.Zs.Ok),I),ie=!B(I)||oe,ce=!U(I),se=!X(I),ue=!Q(I),de=I.length>0,me=1===I.length,pe=(0,a.sEJ)((0,a.OH4)("type",g._g.anomalyDetection),I),be=!me||!ee(I)||!(null===(e=(0,a.YMb)(I))||void 0===e?void 0:e.passive_checks)||pe,ye=!me||!te(I),ve=B(I)||!de,ge=U(I)||!de,he=X(I)||!de,Ze=Q(I)||!de,Se=ee(I)||!de,Ee=te(I)||!de;return React.createElement("div",{className:t.flex},React.createElement("div",{className:t.flex},React.createElement("div",{className:t.action},React.createElement(Re,{disabled:ie,icon:React.createElement(l.Z,null),label:n(y.KE_),permitted:ve,testId:"Multiple Acknowledge",onClick:function(){z(I)}})),React.createElement("div",{className:t.action},React.createElement(Re,{disabled:ce,icon:React.createElement(b.Z,null),label:n(y.eRi),permitted:ge,testId:"Multiple Set Downtime",onClick:function(){W(I)}})),React.createElement("div",{className:t.action},React.createElement(Re,{disabled:se,icon:React.createElement(s.Z,null),label:n(y.a3M),permitted:he,testId:"Multiple Check",onClick:function(){V(I)}})),N.length>0&&React.createElement(ne,{resources:N,onClose:function(){z([])},onSuccess:ae}),L.length>0&&React.createElement(Y,{resources:L,onClose:function(){W([])},onSuccess:ae}),J.length>0&&React.createElement(le,{resources:J,onClose:function(){G([])},onSuccess:ae}),P&&React.createElement(fe,{resource:P,onClose:function(){A(null)},onSuccess:ae}),T&&React.createElement(h.Z,{date:new Date,resource:T,onClose:function(){x(null)},onSuccess:ae})),React.createElement(p.Z,{icon:React.createElement(u.Z,{color:"primary",fontSize:"small"}),title:n(y.RYi)},(function(e){var t=e.close;return React.createElement(React.Fragment,null,React.createElement(Ce,{disabled:ue,label:y.sbi,permitted:Ze,testId:"Multiple Disacknowledge",onClick:function(){t(),G(I)}}),React.createElement(Ce,{disabled:be,label:y.HKz,permitted:Se,testId:"Submit a status",onClick:function(){var e;t(),e=ke(I,1)[0],A(e)}}),React.createElement(Ce,{disabled:ye,label:y.Si9,permitted:Ee,testId:"Add a comment",onClick:function(){var e;t(),e=ke(I,1)[0],x(e)}}))})))}},58837:(e,t,n)=>{n.d(t,{Xt:()=>d,Pt:()=>f,c1:()=>p,Yy:()=>m});var r=n(71257),a=n(79895),o=n(75111),i=n(63019),c="".concat(i.cK,"/acknowledge"),l="".concat(i.cK,"/downtime"),s="".concat(i.cK,"/check"),u="".concat(i.cK,"/comments"),d=function(e){return function(t){var n=t.resources,i=t.params,l=n.map((function(e){var t=e.type,n=e.id,r=e.parent,i=e.service_id;return{id:(0,a.fS0)(t,o._g.anomalydetection)?i:n,parent:r?{id:null==r?void 0:r.id}:null,type:o.s6[t]}}));return r.Z.post(c,{acknowledgement:{comment:i.comment,is_notify_contacts:i.notify,is_persistent_comment:i.persistent,is_sticky:i.isSticky,with_services:i.acknowledgeAttachedResources},resources:l},{cancelToken:e})}},m=function(e){return function(t){var n=t.resources,i=t.params,c=n.map((function(e){var t=e.type,n=e.id,r=e.parent,i=e.service_id;return{id:(0,a.fS0)(t,o._g.anomalydetection)?i:n,parent:r?{id:null==r?void 0:r.id}:null,type:o.s6[t]}}));return r.Z.post(l,{downtime:{comment:i.comment,duration:i.duration,end_time:i.endTime,is_fixed:i.fixed,start_time:i.startTime,with_services:i.isDowntimeWithServices},resources:c},{cancelToken:e})}},f=function(e){var t=e.resources,n=e.cancelToken,i=t.map((function(e){var t=e.type,n=e.id,r=e.parent,i=e.service_id;return{id:(0,a.fS0)(t,o._g.anomalydetection)?i:n,parent:r?{id:null==r?void 0:r.id}:null,type:o.s6[t]}}));return r.Z.post(s,{resources:i},{cancelToken:n})},p=function(e){return function(t){var n=t.resources,i=t.parameters;return r.Z.post(u,{resources:n.map((function(e){var t;return{comment:i.comment,date:i.date,id:(0,a.fS0)(e.type,o._g.anomalydetection)?null==e?void 0:e.service_id:e.id,parent:(null==e?void 0:e.parent)?{id:null==e||null===(t=e.parent)||void 0===t?void 0:t.id}:null,type:o.s6[e.type]}}))},{cancelToken:e})}}},83584:(e,t,n)=>{n.d(t,{Z:()=>y});var r=n(81672),a=n(63397),o=n(79895),i=n(16651),c=n(23972),l=n(8934),s=n(97466),u=n(58226),d=n(28748),m=n(70961),f=n(43412),p=n(58837);function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const y=function(e){var t,n,y=e.onClose,v=e.onSuccess,g=e.resource,h=e.date,Z=(0,a.useTranslation)().t,R=(0,l.ZP)(),S=R.toIsoString,C=R.toDateTime,E=(0,s.Z)().showSuccessMessage,k=(t=(0,r.useState)(),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(t,n)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=k[0],O=k[1],P=(0,u.Z)({request:p.c1}),A=P.sendRequest,j=P.sending,T=function(){if(!(0,o.kKJ)(w)){var e=w||"";return(0,o.zGw)(o.fyY,o.xbD)(e)?Z(f.KeO):void 0}},x=(0,o.kKJ)(T())&&!(0,o.kKJ)(w)&&!j;return React.createElement(d.Z,{open:!0,confirmDisabled:!x,labelConfirm:Z(f.$zi),labelTitle:Z(f.Si9),submitting:j,onCancel:y,onClose:y,onConfirm:function(){var e={comment:w,date:S(h)};A({parameters:e,resources:[g]}).then((function(){E(Z(f.De6)),v(e)}))}},React.createElement(i.ZP,{container:!0,direction:"column",spacing:2},React.createElement(i.ZP,{item:!0},React.createElement(c.Z,{variant:"h6"},C(h))),React.createElement(i.ZP,{item:!0},React.createElement(m.Z,{autoFocus:!0,multiline:!0,required:!0,ariaLabel:Z(f.Nue),error:T(),label:Z(f.Nue),rows:3,style:{width:300},value:w,onChange:function(e){O(e.target.value)}}))))}}}]);