1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{};e.SENTRY_RELEASE={id:"v4.207.0-hotfix.1"};var l=(new e.Error).stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="3b1d6ec5-bbf1-4455-96ef-3b3dc081e04c",e._sentryDebugIdIdentifier="sentry-dbid-3b1d6ec5-bbf1-4455-96ef-3b3dc081e04c")}catch(e){}}();"use strict";(globalThis.rspackChunkvitals||=[]).push([[8348],{30471(e,l,s){s.d(l,{L:()=>A});var t=s(74848),i=s(96540),u=s(40961),r=s(38160),a=s(92429),d=s(61028),o=s(28826),c=s(19732),n=s(98946),m=s(49785),f=s(10449),h=s(20400),T=s(39812),x=s(41722),p=s(61161),y=s(21603),O=s(57491),g=s(89664),b=s(20891),j=s(84426),E=s(69158);let v=({id:e,defaultValues:l,onSubmit:s,moments:u,schedules:r})=>{let{handleSubmit:a,control:d,register:o,setValue:n,watch:v,formState:{errors:S}}=(0,m.mN)({defaultValues:l,criteriaMode:"all",mode:"onSubmit"}),w=v("momentUuid"),R=v("scheduleType"),D=(0,g.Fx)(R),B=(0,i.useMemo)(()=>{if(!w||0===r.length)return null;let e=r.find(e=>e.momentUuid===w)??null;return e&&n("scheduleType",e.scheduleType===b.ER.DAYS?b.ER.WEEKS:b.ER.DAYS),e},[r,w]);return(0,t.jsxs)(c.B,{as:"form",_gap:"l",id:e,onSubmit:a(s),width:"full",children:[(0,t.jsx)(O.z,{label:(0,E.Tl)("luscii.scheduleBuilder.ui.moment.label"),errorMessage:S.momentUuid?.message,children:(0,t.jsx)(m.xI,{control:d,name:"momentUuid",render:({field:{value:e,name:l,onChange:s}})=>(0,t.jsx)(f.l,{name:l,placeholder:(0,E.Tl)("luscii.scheduleBuilder.ui.moment.placeholder"),value:e,onChange:s,options:(0,j.OT)(u)}),rules:{required:(0,E.Tl)("tma.fieldIsRequired")}})}),B&&(0,t.jsxs)(h.A,{color:"blue",children:[(0,t.jsx)(T.EY,{variant:"strong",color:"blue-800",children:B?.scheduleType===b.ER.DAYS?(0,E.Tl)("luscii.scheduleBuilder.formatSet.week.title"):(0,E.Tl)("luscii.scheduleBuilder.formatSet.day.title")}),(0,t.jsx)(T.EY,{color:"blue-800",children:B?.scheduleType===b.ER.DAYS?(0,E.Tl)("luscii.scheduleBuilder.formatSet.week.body"):(0,E.Tl)("luscii.scheduleBuilder.formatSet.day.body")})]}),!B&&(0,t.jsx)(x.k,{title:(0,E.Tl)("luscii.scheduleBuilder.ui.format.label"),children:(0,j.IC)().map(({label:e,value:l})=>(0,t.jsx)(p.Z,{id:l,...o("scheduleType"),value:l,label:e},l))}),(0,t.jsx)(x.k,{title:(0,E.Tl)("luscii.protocol.scheduleDetails.scheduleStart.label"),children:[{text:(0,E.Tl)("luscii.scheduleBuilder.ui.format.onMoment"),value:b.ew.NONE},{text:(0,E.Tl)("luscii.scheduleBuilder.ui.format.custom"),value:b.ew.CUSTOM}].map(({value:e,text:l})=>(0,t.jsx)(p.Z,{id:e,...o("startOffsetType"),value:e,label:l},e))}),v("startOffsetType")===b.ew.CUSTOM&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.o,{label:(0,E.Tl)("luscii.scheduleBuilder.ui.format.label.custom"),errorText:S.startOffsetValue?.message,isError:!S.startOffsetValue,...o("startOffsetValue",{valueAsNumber:!0,onChange:e=>{n("startOffsetValue",e.currentTarget.value,{shouldValidate:!0})},min:{value:D.minimumOffsetValue,message:(0,E.Tl)("luscii.scheduleBuilder.ui.customFormat.error.minimum",{value:D.minimumOffsetValue})},max:{value:D.maximumOffsetValue,message:(0,E.Tl)("luscii.scheduleBuilder.ui.customFormat.error.maximum",{value:D.maximumOffsetValue})},required:(0,E.Tl)("tma.fieldIsRequired")}),prefix:R===b.ER.DAYS?(0,E.Tl)("luscii.base.time.day"):(0,E.Tl)("luscii.base.time.week"),type:"number"}),(0,t.jsx)(O.z,{label:(0,E.Tl)("luscii.frequencies.selectWeekAfterStart.title"),children:(0,t.jsx)(m.xI,{control:d,name:"startOffsetDirection",render:({field:{value:e,name:l,onChange:s}})=>(0,t.jsx)(f.l,{name:l,value:e,onChange:s,options:(0,g.PD)(),width:"lg"})})})]})]})};var S=s(7052);let w=({id:e,defaultValues:l,onSubmit:s,momentName:i,getNumberOfTimelineEntitiesBeforeOffset:u})=>{let{control:r,handleSubmit:a,register:d,setValue:o,watch:n,formState:{errors:T}}=(0,m.mN)({defaultValues:l,criteriaMode:"all",mode:"onSubmit"}),j=n("scheduleType"),v=n("momentUuid"),w=(0,g.Fx)(j),R=e=>{let l=n("startOffsetType"),s=n("startOffsetValue"),t=(0,g.hs)(l===b.ew.NONE?0:s,j);return(u?.({offset:t,offsetIsNegative:e})??0)<1||("day"===j?(0,E.Tl)("luscii.protocol.schedule.edit.error.daysPopulated"):(0,E.Tl)("luscii.protocol.schedule.edit.error.weeksPopulated"))};return(0,t.jsxs)(c.B,{as:"form",_gap:"l",id:e,onSubmit:a(s),width:"full",children:[(0,t.jsx)("input",{type:"hidden",value:j}),(0,t.jsx)("input",{type:"hidden",value:v}),(T.startOffsetValue||T.startOffsetDirection)&&(0,t.jsx)(h.A,{icon:S.A,color:"red",text:(0,E.Tl)("luscii.dialog.updateStartDate.body")}),(0,t.jsx)(h.A,{color:"blue",text:(0,E.Tl)(j===b.ER.DAYS?"luscii.protocol.schedule.edit.info.day":"luscii.protocol.schedule.edit.info.week",{value:i})}),(0,t.jsx)(x.k,{title:(0,E.Tl)("luscii.protocol.scheduleDetails.scheduleStart.label"),children:[{text:(0,E.Tl)("luscii.scheduleBuilder.ui.format.onMoment"),value:b.ew.NONE},{text:(0,E.Tl)("luscii.scheduleBuilder.ui.format.custom"),value:b.ew.CUSTOM}].map(({value:e,text:l})=>(0,t.jsx)(p.Z,{id:e,...d("startOffsetType"),value:e,label:l},e))}),n("startOffsetType")===b.ew.CUSTOM&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.o,{label:(0,E.Tl)("luscii.scheduleBuilder.ui.format.label.custom"),errorText:T.startOffsetValue?.message,isError:!T.startOffsetValue,...d("startOffsetValue",{valueAsNumber:!0,onChange:e=>{o("startOffsetValue",e.currentTarget.value,{shouldValidate:!0})},min:{value:w.minimumOffsetValue,message:(0,E.Tl)("luscii.scheduleBuilder.ui.customFormat.error.minimum",{value:w.minimumOffsetValue})},max:{value:w.maximumOffsetValue,message:(0,E.Tl)("luscii.scheduleBuilder.ui.customFormat.error.maximum",{value:w.maximumOffsetValue})},validate:()=>R(!0),required:(0,E.Tl)("tma.fieldIsRequired")}),prefix:j===b.ER.DAYS?(0,E.Tl)("luscii.base.time.day"):(0,E.Tl)("luscii.base.time.week"),t
1ype:"number"}),(0,t.jsx)(O.z,{label:(0,E.Tl)("luscii.frequencies.selectWeekAfterStart.title"),errorMessage:T.startOffsetDirection?.message,children:(0,t.jsx)(m.xI,{control:r,name:"startOffsetDirection",render:({field:{value:e,name:l,onChange:s}})=>(0,t.jsx)(f.l,{name:l,value:e,onChange:s,options:(0,g.PD)(),width:"lg"}),rules:{validate:e=>R("before"===e)}})})]})]})};var R=s(60998);let D=({open:e,onClose:l,onDelete:s,isDeleting:u})=>{let r=(0,i.useId)();return(0,t.jsxs)(a.yZ,{"aria-labelledby":r,open:e,onClose:l,size:"s",children:[(0,t.jsxs)(a.yZ.Header,{children:[(0,t.jsxs)(c.B,{align:"center",axis:"x",_gap:"l",justify:"start",width:"full",children:[(0,t.jsx)(R.A,{className:"dialog-header-icon ui:h-12 ui:w-12 ui:text-primary"}),(0,t.jsx)(a.yZ.Title,{id:r,children:(0,E.Tl)("tma.delete")})]}),(0,t.jsx)(a.yZ.CloseButton,{onClick:l})]}),(0,t.jsx)(d.c,{}),(0,t.jsx)(a.yZ.Body,{children:(0,t.jsx)(T.EY,{children:(0,E.Tl)("tma.confirmDelete")})}),(0,t.jsx)(d.c,{}),(0,t.jsxs)(a.yZ.Actions,{_gap:"l",_p:"l",children:[(0,t.jsx)(o.t,{onClick:l,disabled:u,children:(0,E.Tl)("tma.cancel")}),(0,t.jsx)(n.j,{onClick:s,isPending:u,children:(0,E.Tl)("tma.delete")})]})]})};var B=s(88821),C=s(82437),N=s(85622);let A=({isOpen:e,onClose:l,onDelete:s,protocolUuid:m,moments:f,schedules:h,scheduleToEdit:T,defaultMomentUuid:x=null,getNumberOfTimelineEntitiesBeforeOffset:p})=>{let{identifiers:{organizationUuid:y}}=(0,B.j)(),[O,S]=(0,i.useState)(!1),[R,A]=(0,N.KL)(),[_,I]=(0,N.lD)(),[V,k]=(0,N.Ji)(),U=f?.find(e=>e.uuid===T?.momentUuid),Z=e=>{var s;let t,i=(s=T?.uuid,t=e.scheduleType??b.ER.DAYS,{uuid:s,momentUuid:e.momentUuid??"",scheduleType:t,startOffset:(0,g.hs)(e.startOffsetType===b.ew.NONE?0:e.startOffsetValue,t),startOffsetIsNegative:e.startOffsetDirection===b.rf.BEFORE});T?T&&_({organizationUuid:y,protocolUuid:m,uuid:T.uuid,...i}).unwrap().then(()=>{(0,r.o)({message:(0,E.Tl)("luscii.toaster.workflow.edited.title"),type:"success"}),(0,C.u4)("update_schedule_success"),l()}).catch(()=>{(0,r.o)({message:(0,E.Tl)("luscii.scheduleBuilder.toaster.failure.title"),type:"failure"}),(0,C.u4)("update_schedule_error_moment")}):R({organizationUuid:y,protocolUuid:m,...i}).unwrap().then(()=>{(0,r.o)({message:(0,E.Tl)("tma.workflowForm.success"),type:"success"}),(0,C.u4)("create_schedule_success"),l()}).catch(()=>{(0,r.o)({message:(0,E.Tl)("luscii.scheduleBuilder.toaster.failure.title"),type:"failure"}),(0,C.u4)("create_schedule_error_moment")})},L=(0,i.useId)(),P=T?"edit-schedule-form":"add-schedule-form",q=1;return T&&(q=(0,j.Ec)(T)??1),(0,t.jsx)(t.Fragment,{children:(0,u.createPortal)((0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.yZ,{"aria-labelledby":L,open:e,onClose:l,size:"m",children:[(0,t.jsxs)(a.yZ.Header,{children:[(0,t.jsx)(a.yZ.Title,{id:L,children:T?(0,E.Tl)("luscii.schedule.edit.title"):(0,E.Tl)("luscii.schedule.addModal.title")}),(0,t.jsx)(a.yZ.CloseButton,{onClick:l})]}),(0,t.jsx)(d.c,{}),(0,t.jsx)(a.yZ.Body,{style:{overflowY:"visible"},children:(0,t.jsx)(t.Fragment,{children:T?(0,t.jsx)(w,{id:P,defaultValues:{momentUuid:T.momentUuid,scheduleType:T.scheduleType,startOffsetType:0===q?b.ew.NONE:b.ew.CUSTOM,startOffsetValue:Math.abs(q),startOffsetDirection:q<0?b.rf.BEFORE:b.rf.AFTER},onSubmit:Z,momentName:U?.name??"",getNumberOfTimelineEntitiesBeforeOffset:p}):(0,t.jsx)(v,{id:P,defaultValues:{momentUuid:x,scheduleType:b.ER.DAYS,startOffsetType:b.ew.NONE,startOffsetValue:0,startOffsetDirection:"before"},onSubmit:Z,moments:f??[],schedules:h})})}),(0,t.jsx)(a.yZ.Footer,{children:(0,t.jsxs)(a.yZ.Actions,{justify:T?"between":"end",width:"full",children:[T&&(0,t.jsx)(o.t,{onClick:()=>S(!0),isPending:k.isLoading,children:(0,E.Tl)("luscii.schedule.button.deleteSchedule")}),(0,t.jsxs)(c.B,{axis:"x",_gap:"m",children:[(0,t.jsx)(o.t,{disabled:A.isLoading||I.isLoading,onClick:l,children:(0,E.Tl)("tma.cancel")}),(0,t.jsx)(n.j,{isPending:A.isLoading||I.isLoading,form:P,type:"submit",children:(0,E.Tl)("tma.submit")})]})]})})]}),O&&(0,t.jsx)(D,{open:O,onClose:()=>S(!1),onDelete:()=>{T&&V({organizationUuid:y,uuid:T.uuid}).unwrap().then(()=>{(0,C.u4)("protocol_schedule_delete"),(0,r.o)({message:(0,E.Tl)("luscii.protocol.schedule.delete.toaster.success.message"),type:"success"}),S(!1),s?.()}).catch(()=>{(0,r.o)({message:(0,E.Tl)("luscii.protocol.schedule.delete.toaster.error.message"),type:"failure"})})},isDeleting:k.isLoading})]}),document.body)})}},85622(e,l,s){var t=s(33031),i=s.n(t),u=s(91862),r=s(25136),a=s(21617);let{endpoints:d,useGetProtocolSchedulesQuery:o,useUpdateProtocolScheduleMutation:c,useCreateProtocolScheduleMutation:n,useDeleteProtocolScheduleMutation:m}=r.Iu.injectEndpoints({endpoints:e=>({getProtocolSchedules:e.query({query:({organizationUuid:e,...l})=>({url:`/organizations/${e}/schedules/`,headers:u.B.RequestRTKHeader(u.s.ORGANIZATION),params:l}),providesTags:[a.Rw.PROTOCOL_SCHEDULE],transformResponse:e=>i()(e.data,[e=>e.momentName??"","scheduleType"])}),createProtocolSchedule:e.mutation({query:({organizationUuid:e,...l})=>({url:`/organizations/${e}/schedules`,method:"POST",headers:u.B.RequestRTKHeader(u.s.ORGANIZATION),body:l}),transformResponse:e=>e.data,invalidatesTags:[a.Rw.PROTOCOL_SCHEDULE]}),updateProtocolSchedule:e.mutation({query:({organizationUuid:e,uuid:l,...s})=>({url:`/organizations/${e}/schedules/${l}`,method:"PUT",headers:u.B.RequestRTKHeader(u.s.ORGANIZATION),body:s}),transformResponse:e=>e.data,invalidatesTags:[a.Rw.PROTOCOL_SCHEDULE]}),deleteProtocolSchedule:e.mutation({query:({organizationUuid:e,uuid:l})=>({url:`/organizations/${e}/schedules/${l}`,method:"DELETE",headers:u.B.RequestRTKHeader(u.s.ORGANIZATION)}),invalidatesTags:[a.Rw.PROTOCOL_SCHEDULE,a.Rw.FREQUENCIES]})}),overrideExisting:!1});s.d(l,{},{Ji:m,KL:n,QQ:o,lD:c,vZ:d})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.