window.Sidebar = { props: ['selectedCell'], emits: ['update-cell', 'close'], setup(props, { emit }) { const { ref, watch } = Vue; const shiftType = ref(null); const startTime = ref(''); const endTime = ref(''); const notes = ref(''); const selectedGroups = ref([]); const shiftOptions = [ 'Morning Shift (08:00-16:00)', 'Afternoon Shift (12:00-20:00)', 'Night Shift (20:00-04:00)', 'Training', 'Absence' ]; const groupOptions = [ 'Molecular App', 'EOD Morning', 'EOD Afternoon', 'Special Project' ]; watch(() => props.selectedCell, (newVal) => { if (newVal) { shiftType.value = null; startTime.value = '08:00'; endTime.value = '16:00'; notes.value = ''; selectedGroups.value = []; } }); const save = () => { emit('update-cell', { shiftType: shiftType.value, time: \`\${startTime.value} - \${endTime.value}\`, notes: notes.value, groups: selectedGroups.value }); emit('close'); }; return { shiftType, startTime, endTime, notes, selectedGroups, shiftOptions, groupOptions, save }; }, template: `