"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[9355],{49371:(w,C,t)=>{t.r(C),t.d(C,{default:()=>ya,useMuteTimingNavData:()=>ta});var a=t(39953),h=t(53721),v=t(33155),y=t(67650),B=t(762),A=t(41407),l=t(14058),R=t(82803),p=t(84766),T=t(2827),E=t(96227),P=t(38637),S=t(4919),G=t(57721),$=t(72401),F=t(328),U=t(79493),H=t(14949),x=t(76716),D=t(86832);const N=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],z=["january","february","march","april","may","june","july","august","september","october","november","december"],k={times:[{start_time:"",end_time:""}],weekdays:"",days_of_month:"",months:"",years:"",location:""},J=(e,r,i)=>e?e.split(",").map(o=>o.trim()).every(o=>o.split(":").every(r))||i:!0,V=e=>e?e.split(",").map(r=>r.trim()):void 0,ia=e=>{const r=e.time_intervals.map(({times:i,weekdays:o,days_of_month:u,months:d,years:M,location:s})=>{const n={times:i.filter(({start_time:c,end_time:m})=>!!c&&!!m),weekdays:V(o)?.map(c=>c.toLowerCase()),days_of_month:V(u),months:V(d),years:V(M),location:s||void 0};return(0,D.omitBy)(n,D.isUndefined)});return{name:e.name,time_intervals:r}};var Q=t(61324),Z=t(27366),Y=t(12190),ra=t(74661),X=t(69171),na=t(68497),W=t(61868);const q="Times must be between 00:00 and 24:00 UTC",oa=({intervalIndex:e})=>{const r=(0,R.wW)(sa),{register:i,formState:o,getValues:u}=(0,l.Gc)(),{fields:d,append:M,remove:s}=(0,l.Dq)({name:`time_intervals.${e}.times`}),n=o.errors.time_intervals?.[e],c=n?.times?.some(m=>m?.start_time||m?.end_time)??!1;return a.createElement("div",null,a.createElement(E.g,{className:r.field,label:"Time range",description:"The time inclusive of the starting time and exclusive of the end time in UTC",invalid:c},a.createElement(a.Fragment,null,d.map((m,g)=>{const f=n?.times?.[g],j=`time_intervals.${e}.times.${g}.start_time`,I=`time_intervals.${e}.times.${g}.end_time`,_=()=>{const b=u(j),K=u(I);return[b,K]};return a.createElement("div",{className:r.timeRange,key:m.id},a.createElement(ra.Z,null,a.createElement(X._,{label:"Start time",invalid:!!f?.start_time,error:f?.start_time?.message},a.createElement(P.I,{...i(j,{validate:b=>{if(!(0,W.ot)(b))return q;const[L,O]=_();if(!(0,W.kO)(L,O))return"Start time must be before end time"}}),className:r.timeRangeInput,maxLength:5,suffix:a.createElement(Y.J,{name:"clock-nine"}),defaultValue:m.start_time,placeholder:"HH:mm","data-testid":"mute-timing-starts-at"})),a.createElement(X._,{label:"End time",invalid:!!f?.end_time,error:f?.end_time?.message},a.createElement(P.I,{...i(`time_intervals.${e}.times.${g}.end_time`,{validate:b=>{if(!(0,W.ot)(b))return q;const[L,O]=_();if(!(0,W.kO)(L,O))return"End time must be after start time"}}),className:r.timeRangeInput,maxLength:5,suffix:a.createElement(Y.J,{name:"clock-nine"}),defaultValue:m.end_time,placeholder:"HH:mm","data-testid":"mute-timing-ends-at"})),a.createElement(na.h,{className:r.deleteTimeRange,title:"Remove",name:"trash-alt",onClick:b=>{b.preventDefault(),s(g)},tooltip:"Remove time range"})))}))),a.createElement(S.zx,{className:r.addTimeRange,variant:"secondary",type:"button",icon:"plus",onClick:()=>M({start_time:"",end_time:""})},"Add another time range"))},sa=e=>({field:(0,A.css)`
    margin-bottom: 0;
  `,timeRange:(0,A.css)`
    margin-bottom: ${e.spacing(1)};
  `,timeRangeInput:(0,A.css)`
    width: 90px;
  `,deleteTimeRange:(0,A.css)`
    margin: ${e.spacing(1)} 0 0 ${e.spacing(.5)};
  `,addTimeRange:(0,A.css)`
    margin-bottom: ${e.spacing(2)};
  `});var ca=t(9558);const ma=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Ciudad_Juarez","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Kyiv","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GMT","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Local","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kanton","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","UTC"],la=e=>{const r=ma.map(i=>({label:i,value:i}));return a.createElement(ca.Ph,{...e,options:r})},ua=()=>{const e=(0,R.wW)(aa),{formState:r,register:i,setValue:o}=(0,l.Gc)(),{fields:u,append:d,remove:M}=(0,l.Dq)({name:"time_intervals"});return a.createElement(T.C,{label:"Time intervals"},a.createElement(a.Fragment,null,a.createElement("p",null,"A time interval is a definition for a moment in time. All fields are lists, and at least one list element must be satisfied to match the field. If a field is left blank, any moment of time will match the field. For an instant of time to match a complete time interval, all fields must match. A mute timing can contain multiple time intervals."),a.createElement(Z.K,{direction:"column",gap:2},u.map((s,n)=>{const c=r.errors;return i(`time_intervals.${n}.location`),a.createElement("div",{key:s.id,className:e.timeIntervalSection},a.createElement(oa,{intervalIndex:n}),a.createElement(E.g,{label:"Location",invalid:!!c.location,error:c.location?.message},a.createElement(la,{prefix:a.createElement(Y.J,{name:"map-marker"}),width:50,onChange:m=>{o(`time_intervals.${n}.location`,m.value)},defaultValue:{label:s.location,value:s.location},"data-testid":"mute-timing-location"})),a.createElement(E.g,{label:"Days of the week"},a.createElement(ga,{onChange:m=>{o(`time_intervals.${n}.weekdays`,m)},defaultValue:s.weekdays})),a.createElement(E.g,{label:"Days of the month",description:"The days of the month, 1-31, of a month. Negative values can be used to represent days which begin at the end of the month",invalid:!!c.time_intervals?.[n]?.days_of_month,error:c.time_intervals?.[n]?.days_of_month?.message},a.createElement(P.I,{...i(`time_intervals.${n}.days_of_month`,{validate:m=>J(m,g=>{const f=parseInt(g,10);return f>-31&&f<0||f>0&&f<32},"Invalid day")}),width:50,defaultValue:s.days_of_month,placeholder:"Example: 1, 14:16, -1","data-testid":"mute-timing-days"})),a.createElement(E.g,{label:"Months",description:"The months of the year in either numerical or the full calendar month",invalid:!!c.time_intervals?.[n]?.months,error:c.time_intervals?.[n]?.months?.message},a.createElement(P.I,{...i(`time_intervals.${n}.months`,{validate:m=>J(m,g=>z.includes(g)||parseInt(g,10)<13&&parseInt(g,10)>0,"Invalid month")}),width:50,placeholder:"Example: 1:3, may:august, december",defaultValue:s.months,"data-testid":"mute-timing-months"})),a.createElement(E.g,{label:"Years",invalid:!!c.time_intervals?.[n]?.years,error:c.time_intervals?.[n]?.years?.message??""},a.createElement(P.I,{...i(`time_intervals.${n}.years`,{validate:m=>J(m,g=>/^\d{4}$/.test(g),"Invalid year")}),width:50,placeholder:"Example: 2021:2022, 2030",defaultValue:s.years,"data-testid":"mute-timing-years"})),a.createElement(S.zx,{type:"button",variant:"destructive",fill:"outline",icon:"trash-alt",onClick:()=>M(n)},"Remove time interval"))})),a.createElement(S.zx,{type:"button",variant:"secondary",className:e.removeTimeIntervalButton,onClick:()=>{d(k)},icon:"plus"},"Add another time interval")))},Aa=e=>{const r=e.split(",").map(i=>i.trim()).flatMap(i=>i.includes(":")?da(i):i).map(i=>i.toLowerCase()).filter(i=>N.includes(i));return(0,D.uniq)(r)};function da(e){const[r="",i=""]=e.split(":"),o=N.indexOf(r),u=N.indexOf(i);return N.slice(o,u+1)}const ga=({defaultValue:e="",onChange:r})=>{const i=(0,R.wW)(aa),o=Aa(e),[u,d]=(0,a.useState)(o),M=s=>{u.includes(s)?d(n=>(0,D.without)(n,s)):d(n=>(0,D.concat)(n,s))};return(0,a.useEffect)(()=>{r(u.join(", "))},[u,r]),a.createElement("div",{"data-testid":"mute-timing-weekdays"},a.createElement(Z.K,{gap:1},N.map(s=>{const n=(0,A.cx)(i.dayOfTheWeek,u.includes(s)&&"selected"),c=s.slice(0,3);return a.createElement("button",{type:"button",key:s,className:n,onClick:()=>M(s)},(0,D.upperFirst)(c))})))},aa=e=>({input:(0,A.css)`
    width: 400px;
  `,timeIntervalSection:(0,A.css)`
    background-color: ${e.colors.background.secondary};
    padding: ${e.spacing(2)};
  `,removeTimeIntervalButton:(0,A.css)`
    margin-top: ${e.spacing(2)};
  `,dayOfTheWeek:(0,A.css)`
    cursor: pointer;
    user-select: none;
    padding: ${e.spacing(1)} ${e.spacing(3)};

    border: solid 1px ${e.colors.border.medium};
    background: none;
    border-radius: ${e.shape.radius.default};

    color: ${e.colors.text.secondary};

    &.selected {
      font-weight: ${e.typography.fontWeightBold};
      color: ${e.colors.primary.text};
      border-color: ${e.colors.primary.border};
      background: ${e.colors.primary.transparent};
    }
  `}),fa=e=>{const r={name:"",time_intervals:[k]};if(!e)return r;const i=e.time_intervals.map(o=>({times:o.times??k.times,weekdays:o.weekdays?.join(", ")??k.weekdays,days_of_month:o.days_of_month?.join(", ")??k.days_of_month,months:o.months?.join(", ")??k.months,years:o.years?.join(", ")??k.years,location:o.location??k.location}));return{name:e.name,time_intervals:i}},pa=({muteTiming:e,showError:r,loading:i,provenance:o})=>{const u=(0,G.useDispatch)(),{selectedAlertmanager:d}=(0,F.ZA)(),M=(0,R.wW)(Ea),[s,n]=(0,a.useState)(!1),{currentData:c}=(0,$.W)(d),m=c?.alertmanager_config,g=fa(e),f=(0,l.cI)({defaultValues:g}),j=I=>{if(!c)return;const _=ia(I),b=e?m?.mute_time_intervals?.filter(({name:O})=>O!==e.name):m?.mute_time_intervals,K={...c,alertmanager_config:{...m,route:e&&_.name!==e.name?(0,H.FM)(_.name,e.name,m?.route??{}):m?.route,mute_time_intervals:[...b||[],_]}},L=u((0,U.mM)({newConfig:K,oldConfig:c,alertManagerSourceName:d,successMessage:"Mute timing saved",redirectPath:"/alerting/routes/",redirectSearch:"tab=mute_timings"}));n(!0),L.unwrap().finally(()=>{n(!1)})};return a.createElement(a.Fragment,null,o&&a.createElement(Q.Xq,{resource:Q.Uv.MuteTiming}),i&&a.createElement(p.u,{text:"Loading mute timing"}),r&&a.createElement(v.b,{title:"No matching mute timing found"}),c&&!i&&!r&&a.createElement(l.RV,{...f},a.createElement("form",{onSubmit:f.handleSubmit(j),"data-testid":"mute-timing-form"},a.createElement(T.C,{label:"Create mute timing",disabled:!!o||s},a.createElement(E.g,{required:!0,label:"Name",description:"A unique name for the mute timing",invalid:!!f.formState.errors?.name,error:f.formState.errors.name?.message},a.createElement(P.I,{...f.register("name",{required:!0,validate:I=>{if(!e)return m?.mute_time_intervals?.find(({name:b})=>I===b)?`Mute timing already exists for "${I}"`:!0}}),className:M.input,"data-testid":"mute-timing-name"})),a.createElement(ua,null),a.createElement(S.zx,{type:"submit",className:M.submitButton,disabled:s},"Save mute timing"),a.createElement(S.Qj,{type:"button",variant:"secondary",fill:"outline",href:(0,x.eQ)("/alerting/routes/",d,{tab:"mute_timings"}),disabled:s},"Cancel")))))},Ea=e=>({input:(0,A.css)`
    width: 400px;
  `,submitButton:(0,A.css)`
    margin-right: ${e.spacing(1)};
  `}),ea=pa,ha=()=>{const[e]=(0,y.K)(),{selectedAlertmanager:r}=(0,F.ZA)(),{currentData:i,isLoading:o,error:u}=(0,$.W)(r,{refetchOnFocus:!0,refetchOnReconnect:!0}),d=i?.alertmanager_config,M=(0,a.useCallback)(s=>{const n=d?.mute_time_intervals?.find(({name:c})=>c===s);if(n){const c=d?.muteTimeProvenances?.[n.name];return{...n,provenance:c}}return n},[d]);return a.createElement(a.Fragment,null,u&&!o&&!i&&a.createElement(v.b,{severity:"error",title:`Error loading Alertmanager config for ${r}`},u.message||"Unknown error."),i&&!u&&a.createElement(h.rs,null,a.createElement(h.AW,{exact:!0,path:"/alerting/routes/mute-timing/new"},a.createElement(ea,{loading:o})),a.createElement(h.AW,{exact:!0,path:"/alerting/routes/mute-timing/edit"},()=>{if(e.muteName){const s=M(String(e.muteName)),n=s?.provenance;return a.createElement(ea,{loading:o,muteTiming:s,showError:!s&&!o,provenance:n})}return a.createElement(h.l_,{to:"/alerting/routes"})})))},va=()=>{const e=ta();return a.createElement(B.O,{pageId:"am-routes",pageNav:e,accessType:"notification"},a.createElement(ha,null))};function ta(){const{isExact:e,path:r}=(0,h.$B)(),[i,o]=(0,a.useState)();return(0,a.useEffect)(()=>{r==="/alerting/routes/mute-timing/new"?o({id:"alert-policy-new",text:"Add mute timing"}):r==="/alerting/routes/mute-timing/edit"&&o({id:"alert-policy-edit",text:"Edit mute timing"})},[r,e]),i}const ya=va},61324:(w,C,t)=>{t.d(C,{C0:()=>A,Uv:()=>y,Xq:()=>B});var a=t(39953),h=t(33155),v=t(12608),y=(l=>(l.ContactPoint="contact point",l.Template="template",l.MuteTiming="mute timing",l.AlertRule="alert rule",l.RootNotificationPolicy="root notification policy",l))(y||{});const B=({resource:l})=>a.createElement(h.b,{title:`This ${l} cannot be edited through the UI`,severity:"info"},"This ",l," has been provisioned, that means it was created by config. Please contact your server admin to update this ",l,"."),A=()=>a.createElement(v.C,{text:"Provisioned",color:"purple"})},61868:(w,C,t)=>{t.d(C,{Nx:()=>R,kO:()=>l,ot:()=>A});var a=t(52291),h=t.n(a),v=t(39953),y=t(14949);const B=/^((([01][0-9])|(2[0-3])):[0-5][0-9])$|(^24:00$)/,A=p=>p?B.test(p):!0,l=(p,T)=>{if(!p&&!T)return!0;if(!p&&T||p&&!T)return!1;const E="HH:mm",P=h()().startOf("day").add(p,E),S=h()().startOf("day").add(T,E);return!!(p&&T&&P.isBefore(S)||p&&T&&S.isAfter(P))};function R(p){return p.time_intervals.map((E,P)=>{const{times:S,weekdays:G,days_of_month:$,months:F,years:U,location:H}=E,x=(0,y.u6)(S,H),D=(0,y.v7)(G),N=(0,y.J8)($),z=(0,y.m8)(F),k=(0,y.qw)(U);return v.createElement(v.Fragment,{key:JSON.stringify(E)+P},`${x} ${D}`,v.createElement("br",null),[N,z,k].join(" | "),v.createElement("br",null))})}},72401:(w,C,t)=>{t.d(C,{W:()=>h});var a=t(37546);function h(v,y){const B=a.alertmanagerApi.endpoints.getAlertmanagerConfiguration.useQuery(v??"",{...y,skip:!v});return{...B,error:B.error}}}}]);

//# sourceMappingURL=MuteTimings.cc5a2ccff9496501fb6a.js.map