From 717c62633f0b4fd58ae1ef20a18c5330f2dd31ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Glasn=C3=A1k?= Date: Mon, 19 Jan 2026 16:24:48 +0100 Subject: [PATCH] feat(timeline): enhance employee timeline to include draft tasks and improve timeblock processing --- app/dist/js/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/dist/js/index.js b/app/dist/js/index.js index 047e74a..188fa11 100644 --- a/app/dist/js/index.js +++ b/app/dist/js/index.js @@ -1274,7 +1274,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var cor /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ \"./node_modules/core-js/modules/esnext.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ \"./node_modules/core-js/modules/esnext.iterator.filter.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/esnext.iterator.map.js */ \"./node_modules/core-js/modules/esnext.iterator.map.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var _vuelidate_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @vuelidate/core */ \"./node_modules/@vuelidate/core/dist/index.esm.js\");\n/* harmony import */ var _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @vuelidate/validators */ \"./node_modules/@vuelidate/validators/dist/index.esm.js\");\n/* harmony import */ var _plugins_tm_utils_useEmployeeTimeline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/plugins/tm@_utils/useEmployeeTimeline */ \"./src/plugins/tm@_utils/useEmployeeTimeline.ts\");\n/* harmony import */ var _plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/plugins/tm@_utils/timeblock.utils */ \"./src/plugins/tm@_utils/timeblock.utils.ts\");\n/* harmony import */ var _a_employee_timeblock_header_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./a-employee-timeblock-header.vue */ \"./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-header.vue\");\n/* harmony import */ var _a_employee_timeblock_timeline_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./a-employee-timeblock-timeline.vue */ \"./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-timeline.vue\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_10__);\n/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ \"./node_modules/console-browserify/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n// Configuration: Set to false to allow editing timeblocks with existing IDs\nconst ALLOW_EDITING_EXISTING_TIMEBLOCKS = true;\nconst HOUR_WIDTH = 60; // pixels per hour (desktop)\nconst HOUR_WIDTH_MOBILE = 50; // pixels per hour (mobile)\nconst START_HOUR = 0; // Start from midnight\nconst END_HOUR = 24; // End at midnight\n// Check if mobile\n/* harmony default export */ __webpack_exports__[\"default\"] = (/*@__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_3__.defineComponent)({\n __name: 'a-employee-timeblock',\n props: {\n modelValue: {\n type: Object,\n required: true\n },\n employee: {\n type: [Object, null],\n required: true\n },\n allEmployeeTimeblocks: {\n type: Array,\n required: false,\n default: () => []\n },\n allTimeblocks: {\n type: Array,\n required: false,\n default: () => []\n },\n deletedTimeblockIds: {\n type: Array,\n required: false,\n default: () => []\n },\n editingBlockerId: {\n type: [Number, null],\n required: false,\n default: null\n },\n currentIndex: {\n type: Number,\n required: false,\n default: 0\n },\n deletable: {\n type: Boolean,\n required: false,\n default: false\n },\n index: {\n type: Number,\n required: false,\n default: 0\n }\n },\n emits: [\"update:modelValue\", \"addTimeblock\", \"removeTimeblock\"],\n setup(__props, {\n expose: __expose,\n emit: __emit\n }) {\n const props = __props;\n const emit = __emit;\n const timelineRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(null);\n // Check if timeblock is editable (based on whether it has an ID)\n const isEditable = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (ALLOW_EDITING_EXISTING_TIMEBLOCKS) return true;\n return !props.modelValue.id;\n });\n // Minimum date is today (no past dates)\n const minDate = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(new Date());\n // Timeline configuration\n const isMobile = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(false);\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.onMounted)(() => {\n isMobile.value = window.innerWidth <= 768;\n window.addEventListener('resize', () => {\n isMobile.value = window.innerWidth <= 768;\n });\n // Center timeline on mount\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n });\n const hourWidth = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => isMobile.value ? HOUR_WIDTH_MOBILE : HOUR_WIDTH);\n // Custom validator for time range\n const timeRangeValid = (value, siblings) => {\n if (!siblings.starts_at_time || !siblings.ends_at_time || !siblings.date) {\n return true;\n }\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(siblings);\n if (!start || !end) return true;\n return end > start;\n };\n // Custom validator: field is required when start OR end time is filled\n // Uses siblings to check the current state of all fields\n // const requiredWhenHasTime = (value: any, siblings: any) => {\n // // Check if timeblock has any TIME data (start or end time)\n // const hasStart = !!siblings.starts_at_time;\n // const hasEnd = !!siblings.ends_at_time;\n // const hasAnyTimeData = hasStart || hasEnd;\n // // If no time data, no validation needed\n // if (!hasAnyTimeData) return true;\n // // When time data exists, field must have value (not null, undefined, or empty string)\n // return value !== null && value !== undefined && value !== '';\n // };\n // Vuelidate rules - if start OR end is filled, all three fields are required\n const rules = {\n date: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Vyberte dátum', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required)\n },\n starts_at_time: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Zadajte začiatok', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required)\n },\n ends_at_time: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Zadajte koniec', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required),\n timeRangeValid: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Koniec musí byť po začiatku', timeRangeValid)\n }\n };\n const v$ = (0,_vuelidate_core__WEBPACK_IMPORTED_MODULE_4__.useVuelidate)(rules, props.modelValue, {\n $autoDirty: true\n });\n // Error visibility logic: show errors if field is dirty OR if the opposite time field is filled\n const hasStartTimeError = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Show error if field is dirty and has error\n if (v$.value.starts_at_time.$dirty && v$.value.starts_at_time.$error) {\n return true;\n }\n // OR if end time is filled but start is not\n if (props.modelValue.ends_at_time && !props.modelValue.starts_at_time) {\n return v$.value.starts_at_time.$error;\n }\n return false;\n });\n const hasEndTimeError = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Show error if field is dirty and has error\n if (v$.value.ends_at_time.$dirty && v$.value.ends_at_time.$error) {\n return true;\n }\n // OR if start time is filled but end is not\n if (props.modelValue.starts_at_time && !props.modelValue.ends_at_time) {\n return v$.value.ends_at_time.$error;\n }\n return false;\n });\n const endTimeErrorMessage = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (hasEndTimeError.value) {\n return v$.value.ends_at_time.$errors.map(e => e.$message).join(', ');\n }\n return '';\n });\n // Reactive refs for composable\n const employeeRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.employee);\n const dateRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.modelValue.date);\n const timeblockRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.modelValue);\n // Get other timeblocks for the same date (excluding current one)\n // This includes timeblocks from both the current employee and other employees\n const otherTimeblocksForSameDate = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (!props.modelValue.date) return [];\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date).format('YYYY-MM-DD');\n // Use allEmployeeTimeblocks which contains timeblocks for this specific employee\n // Filter out the current timeblock by comparing index directly\n return props.allEmployeeTimeblocks.filter((tb, index) => {\n // Skip current timeblock by index\n if (index === props.currentIndex) {\n return false;\n }\n // Must have required fields\n if (!tb.date || !tb.starts_at_time || !tb.ends_at_time) return false;\n // Must be the same date\n return moment__WEBPACK_IMPORTED_MODULE_10___default()(tb.date).format('YYYY-MM-DD') === currentDate;\n });\n });\n // Use timeline composable\n const editingBlockerIdRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.editingBlockerId);\n const {\n isLoading,\n timelineTasks,\n scheduledTime: _scheduledTime,\n freeTime: _freeTime,\n timeblockDuration,\n refetch,\n conceptTasksRefetch\n } = (0,_plugins_tm_utils_useEmployeeTimeline__WEBPACK_IMPORTED_MODULE_6__.useEmployeeTimeline)(employeeRef, dateRef, timeblockRef, otherTimeblocksForSameDate, editingBlockerIdRef);\n // Force refetch when date changes\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.date, () => {\n if (props.modelValue.date && props.employee?.id) {\n refetch();\n conceptTasksRefetch();\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.onMounted)(() => {\n refetch();\n conceptTasksRefetch();\n });\n // All tasks from timelineTasks are already filtered for the selected date\n // Filter out timeblocks that are being edited or deleted locally\n const scheduledBlocks = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Combine IDs that should be filtered: edited locally or deleted\n const hiddenTimeblockIds = new Set([\n // Timeblock IDs being edited locally\n ...props.allTimeblocks.filter(tb => tb.id).map(tb => tb.id),\n // Timeblock IDs that have been deleted\n ...(props.deletedTimeblockIds || [])]);\n // Filter out tasks whose timeblock IDs should be hidden\n return timelineTasks.value.filter(task => !task._timeblock_id || !hiddenTimeblockIds.has(task._timeblock_id));\n });\n // Convert other unsaved timeblocks to task format for collision detection\n const otherTimeblocksAsTasks = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return otherTimeblocksForSameDate.value.map(tb => {\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(tb);\n if (!start || !end) return null;\n return {\n _real_start: start,\n _real_end: end,\n _timeblock_id: tb.id || null\n };\n }).filter(task => task !== null);\n });\n // Combine scheduled blocks with other unsaved timeblocks for collision detection\n const allBlocksForCollisionCheck = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return [...scheduledBlocks.value, ...otherTimeblocksAsTasks.value];\n });\n // Recalculate collision using filtered scheduled blocks AND other unsaved timeblocks\n // This prevents false collisions with timeblocks being edited, but catches collisions with other unsaved timeblocks\n const collision = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.detectCollision)(props.modelValue, allBlocksForCollisionCheck.value);\n });\n // Recalculate collision segments using filtered scheduled blocks AND other unsaved timeblocks\n const collisionSegments = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.getCollisionSegments)(props.modelValue, allBlocksForCollisionCheck.value);\n });\n // Get current timeblock range\n const currentTimeblockRange = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(props.modelValue);\n return {\n start,\n end\n };\n });\n // Validate that end time is after start time\n const isTimeRangeValid = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (!props.modelValue.starts_at_time || !props.modelValue.ends_at_time) {\n return true; // Don't show error if fields are empty\n }\n const {\n start,\n end\n } = currentTimeblockRange.value;\n if (!start || !end) return true;\n return end > start;\n });\n // Center timeline around middle of work hours\n const centerTimeline = () => {\n if (!timelineRef.value?.timelineScroll) return;\n // Calculate the middle of work hours\n const workStart = props.employee?.work_start ?? 8;\n const workEnd = props.employee?.work_end ?? 17;\n const centerHour = (workStart + workEnd) / 2;\n const centerPosition = (centerHour - START_HOUR) * hourWidth.value;\n const containerWidth = timelineRef.value.timelineScroll.clientWidth;\n timelineRef.value.timelineScroll.scrollLeft = centerPosition - containerWidth / 2;\n };\n // Watch for date changes or employee changes to re-center\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => [props.modelValue.date, props.employee?.id], () => {\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n });\n // Watch for timeline ref to become available and center it\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(timelineRef, newRef => {\n if (newRef?.timelineScroll) {\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n }\n });\n // Watch for loading state - when data finishes loading, center the timeline\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(isLoading, (newIsLoading, oldIsLoading) => {\n // When loading changes from true to false, timeline is re-rendered\n if (oldIsLoading && !newIsLoading) {\n // Wait for DOM to update, then center\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n setTimeout(() => {\n centerTimeline();\n }, 0); // Small delay to ensure DOM is fully rendered\n });\n }\n });\n // Date navigation\n const previousDay = () => {\n if (!props.modelValue.date) return;\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date);\n const newDate = currentDate.clone().subtract(1, 'day').toDate();\n // Don't allow going to past dates\n if (moment__WEBPACK_IMPORTED_MODULE_10___default()(newDate).isBefore(moment__WEBPACK_IMPORTED_MODULE_10___default()(), 'day')) return;\n updateDate(newDate);\n };\n const nextDay = () => {\n if (!props.modelValue.date) return;\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date);\n const newDate = currentDate.clone().add(1, 'day').toDate();\n updateDate(newDate);\n };\n // Update handlers\n const updateDate = date => {\n emit('update:modelValue', {\n ...props.modelValue,\n date\n });\n };\n const updateStartTime = event => {\n const target = event.target;\n emit('update:modelValue', {\n ...props.modelValue,\n starts_at_time: target.value\n });\n };\n const updateEndTime = event => {\n const target = event.target;\n emit('update:modelValue', {\n ...props.modelValue,\n ends_at_time: target.value\n });\n };\n // Handle timeblock updated from timeline (drag/drop or quick add)\n const handleTimeblockUpdated = payload => {\n const {\n starts_at_time\n } = payload;\n let {\n ends_at_time\n } = payload;\n // Fix accidental same start/end time by adding 1 hour to end\n if (starts_at_time === ends_at_time) {\n const [hours, minutes] = starts_at_time.split(':').map(Number);\n const newEndHour = (hours + 1) % 24; // Wrap around at midnight\n ends_at_time = `${String(newEndHour).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;\n }\n emit('update:modelValue', {\n ...props.modelValue,\n starts_at_time,\n ends_at_time\n });\n // Trigger validation after timeline update\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n v$.value.$touch();\n });\n };\n // Expose validate method\n const validate = async () => {\n v$.value.$touch();\n const isValid = await v$.value.$validate();\n return isValid && isTimeRangeValid.value;\n };\n __expose({\n validate\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.ends_at_time, () => {\n if (v$.value.ends_at_time.$model !== props.modelValue.ends_at_time) {\n v$.value.ends_at_time.$model = props.modelValue.ends_at_time;\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.starts_at_time, () => {\n if (v$.value.starts_at_time.$model !== props.modelValue.starts_at_time) {\n v$.value.starts_at_time.$model = props.modelValue.starts_at_time;\n console.log('starts_at_time changed', v$.value.starts_at_time.$model);\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.date, () => {\n if (v$.value.date.$model !== props.modelValue.date) {\n v$.value.date.$model = props.modelValue.date;\n }\n });\n const __returned__ = {\n ALLOW_EDITING_EXISTING_TIMEBLOCKS,\n props,\n emit,\n timelineRef,\n isEditable,\n minDate,\n HOUR_WIDTH,\n HOUR_WIDTH_MOBILE,\n START_HOUR,\n END_HOUR,\n isMobile,\n hourWidth,\n timeRangeValid,\n rules,\n v$,\n hasStartTimeError,\n hasEndTimeError,\n endTimeErrorMessage,\n employeeRef,\n dateRef,\n timeblockRef,\n otherTimeblocksForSameDate,\n editingBlockerIdRef,\n isLoading,\n timelineTasks,\n _scheduledTime,\n _freeTime,\n timeblockDuration,\n refetch,\n conceptTasksRefetch,\n scheduledBlocks,\n otherTimeblocksAsTasks,\n allBlocksForCollisionCheck,\n collision,\n collisionSegments,\n currentTimeblockRange,\n isTimeRangeValid,\n centerTimeline,\n previousDay,\n nextDay,\n updateDate,\n updateStartTime,\n updateEndTime,\n handleTimeblockUpdated,\n validate,\n AEmployeeTimeblockHeader: _a_employee_timeblock_header_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n AEmployeeTimeblockTimeline: _a_employee_timeblock_timeline_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n}));\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use%5B1%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); +eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ \"./node_modules/core-js/modules/esnext.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ \"./node_modules/core-js/modules/esnext.iterator.filter.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/esnext.iterator.map.js */ \"./node_modules/core-js/modules/esnext.iterator.map.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var _vuelidate_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @vuelidate/core */ \"./node_modules/@vuelidate/core/dist/index.esm.js\");\n/* harmony import */ var _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @vuelidate/validators */ \"./node_modules/@vuelidate/validators/dist/index.esm.js\");\n/* harmony import */ var _plugins_tm_utils_useEmployeeTimeline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/plugins/tm@_utils/useEmployeeTimeline */ \"./src/plugins/tm@_utils/useEmployeeTimeline.ts\");\n/* harmony import */ var _plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/plugins/tm@_utils/timeblock.utils */ \"./src/plugins/tm@_utils/timeblock.utils.ts\");\n/* harmony import */ var _a_employee_timeblock_header_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./a-employee-timeblock-header.vue */ \"./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-header.vue\");\n/* harmony import */ var _a_employee_timeblock_timeline_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./a-employee-timeblock-timeline.vue */ \"./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock-timeline.vue\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_10__);\n/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ \"./node_modules/console-browserify/index.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n// Configuration: Set to false to allow editing timeblocks with existing IDs\nconst ALLOW_EDITING_EXISTING_TIMEBLOCKS = true;\nconst HOUR_WIDTH = 60; // pixels per hour (desktop)\nconst HOUR_WIDTH_MOBILE = 50; // pixels per hour (mobile)\nconst START_HOUR = 0; // Start from midnight\nconst END_HOUR = 24; // End at midnight\n// Check if mobile\n/* harmony default export */ __webpack_exports__[\"default\"] = (/*@__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_3__.defineComponent)({\n __name: 'a-employee-timeblock',\n props: {\n modelValue: {\n type: Object,\n required: true\n },\n employee: {\n type: [Object, null],\n required: true\n },\n allEmployeeTimeblocks: {\n type: Array,\n required: false,\n default: () => []\n },\n allTimeblocks: {\n type: Array,\n required: false,\n default: () => []\n },\n deletedTimeblockIds: {\n type: Array,\n required: false,\n default: () => []\n },\n editingBlockerId: {\n type: [Number, null],\n required: false,\n default: null\n },\n currentIndex: {\n type: Number,\n required: false,\n default: 0\n },\n deletable: {\n type: Boolean,\n required: false,\n default: false\n },\n index: {\n type: Number,\n required: false,\n default: 0\n },\n showDraftTasks: {\n type: Boolean,\n required: false,\n default: false\n }\n },\n emits: [\"update:modelValue\", \"addTimeblock\", \"removeTimeblock\"],\n setup(__props, {\n expose: __expose,\n emit: __emit\n }) {\n const props = __props;\n const emit = __emit;\n const timelineRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(null);\n // Check if timeblock is editable (based on whether it has an ID)\n const isEditable = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (ALLOW_EDITING_EXISTING_TIMEBLOCKS) return true;\n return !props.modelValue.id;\n });\n // Minimum date is today (no past dates)\n const minDate = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(new Date());\n // Timeline configuration\n const isMobile = (0,vue__WEBPACK_IMPORTED_MODULE_3__.ref)(false);\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.onMounted)(() => {\n isMobile.value = window.innerWidth <= 768;\n window.addEventListener('resize', () => {\n isMobile.value = window.innerWidth <= 768;\n });\n // Center timeline on mount\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n });\n const hourWidth = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => isMobile.value ? HOUR_WIDTH_MOBILE : HOUR_WIDTH);\n // Custom validator for time range\n const timeRangeValid = (value, siblings) => {\n if (!siblings.starts_at_time || !siblings.ends_at_time || !siblings.date) {\n return true;\n }\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(siblings);\n if (!start || !end) return true;\n return end > start;\n };\n // Custom validator: field is required when start OR end time is filled\n // Uses siblings to check the current state of all fields\n // const requiredWhenHasTime = (value: any, siblings: any) => {\n // // Check if timeblock has any TIME data (start or end time)\n // const hasStart = !!siblings.starts_at_time;\n // const hasEnd = !!siblings.ends_at_time;\n // const hasAnyTimeData = hasStart || hasEnd;\n // // If no time data, no validation needed\n // if (!hasAnyTimeData) return true;\n // // When time data exists, field must have value (not null, undefined, or empty string)\n // return value !== null && value !== undefined && value !== '';\n // };\n // Vuelidate rules - if start OR end is filled, all three fields are required\n const rules = {\n date: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Vyberte dátum', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required)\n },\n starts_at_time: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Zadajte začiatok', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required)\n },\n ends_at_time: {\n requiredWhenHasTime: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Zadajte koniec', _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.required),\n timeRangeValid: _vuelidate_validators__WEBPACK_IMPORTED_MODULE_5__.helpers.withMessage('Koniec musí byť po začiatku', timeRangeValid)\n }\n };\n const v$ = (0,_vuelidate_core__WEBPACK_IMPORTED_MODULE_4__.useVuelidate)(rules, props.modelValue, {\n $autoDirty: true\n });\n // Error visibility logic: show errors if field is dirty OR if the opposite time field is filled\n const hasStartTimeError = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Show error if field is dirty and has error\n if (v$.value.starts_at_time.$dirty && v$.value.starts_at_time.$error) {\n return true;\n }\n // OR if end time is filled but start is not\n if (props.modelValue.ends_at_time && !props.modelValue.starts_at_time) {\n return v$.value.starts_at_time.$error;\n }\n return false;\n });\n const hasEndTimeError = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Show error if field is dirty and has error\n if (v$.value.ends_at_time.$dirty && v$.value.ends_at_time.$error) {\n return true;\n }\n // OR if start time is filled but end is not\n if (props.modelValue.starts_at_time && !props.modelValue.ends_at_time) {\n return v$.value.ends_at_time.$error;\n }\n return false;\n });\n const endTimeErrorMessage = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (hasEndTimeError.value) {\n return v$.value.ends_at_time.$errors.map(e => e.$message).join(', ');\n }\n return '';\n });\n // Reactive refs for composable\n const employeeRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.employee);\n const dateRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.modelValue.date);\n const timeblockRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.modelValue);\n // Get other timeblocks for the same date (excluding current one)\n // This includes timeblocks from both the current employee and other employees\n const otherTimeblocksForSameDate = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (!props.modelValue.date) return [];\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date).format('YYYY-MM-DD');\n // Use allEmployeeTimeblocks which contains timeblocks for this specific employee\n // Filter out the current timeblock by comparing index directly\n return props.allEmployeeTimeblocks.filter((tb, index) => {\n // Skip current timeblock by index\n if (index === props.currentIndex) {\n return false;\n }\n // Must have required fields\n if (!tb.date || !tb.starts_at_time || !tb.ends_at_time) return false;\n // Must be the same date\n return moment__WEBPACK_IMPORTED_MODULE_10___default()(tb.date).format('YYYY-MM-DD') === currentDate;\n });\n });\n // Use timeline composable\n const editingBlockerIdRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.editingBlockerId);\n const showDraftTasksRef = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => props.showDraftTasks);\n const {\n isLoading,\n timelineTasks,\n scheduledTime: _scheduledTime,\n freeTime: _freeTime,\n timeblockDuration,\n refetch,\n conceptTasksRefetch\n } = (0,_plugins_tm_utils_useEmployeeTimeline__WEBPACK_IMPORTED_MODULE_6__.useEmployeeTimeline)(employeeRef, dateRef, timeblockRef, otherTimeblocksForSameDate, editingBlockerIdRef, showDraftTasksRef);\n // Force refetch when date changes\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.date, () => {\n if (props.modelValue.date && props.employee?.id) {\n refetch();\n conceptTasksRefetch();\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.onMounted)(() => {\n refetch();\n conceptTasksRefetch();\n });\n // All tasks from timelineTasks are already filtered for the selected date\n // Filter out timeblocks that are being edited or deleted locally\n const scheduledBlocks = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n // Combine IDs that should be filtered: edited locally or deleted\n const hiddenTimeblockIds = new Set([\n // Timeblock IDs being edited locally\n ...props.allTimeblocks.filter(tb => tb.id).map(tb => tb.id),\n // Timeblock IDs that have been deleted\n ...(props.deletedTimeblockIds || [])]);\n // Filter out tasks whose timeblock IDs should be hidden\n return timelineTasks.value.filter(task => !task._timeblock_id || !hiddenTimeblockIds.has(task._timeblock_id));\n });\n // Convert other unsaved timeblocks to task format for collision detection\n const otherTimeblocksAsTasks = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return otherTimeblocksForSameDate.value.map(tb => {\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(tb);\n if (!start || !end) return null;\n return {\n _real_start: start,\n _real_end: end,\n _timeblock_id: tb.id || null\n };\n }).filter(task => task !== null);\n });\n // Combine scheduled blocks with other unsaved timeblocks for collision detection\n const allBlocksForCollisionCheck = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return [...scheduledBlocks.value, ...otherTimeblocksAsTasks.value];\n });\n // Recalculate collision using filtered scheduled blocks AND other unsaved timeblocks\n // This prevents false collisions with timeblocks being edited, but catches collisions with other unsaved timeblocks\n const collision = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.detectCollision)(props.modelValue, allBlocksForCollisionCheck.value);\n });\n // Recalculate collision segments using filtered scheduled blocks AND other unsaved timeblocks\n const collisionSegments = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n return (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.getCollisionSegments)(props.modelValue, allBlocksForCollisionCheck.value);\n });\n // Get current timeblock range\n const currentTimeblockRange = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n const {\n start,\n end\n } = (0,_plugins_tm_utils_timeblock_utils__WEBPACK_IMPORTED_MODULE_7__.timeblockToDateRange)(props.modelValue);\n return {\n start,\n end\n };\n });\n // Validate that end time is after start time\n const isTimeRangeValid = (0,vue__WEBPACK_IMPORTED_MODULE_3__.computed)(() => {\n if (!props.modelValue.starts_at_time || !props.modelValue.ends_at_time) {\n return true; // Don't show error if fields are empty\n }\n const {\n start,\n end\n } = currentTimeblockRange.value;\n if (!start || !end) return true;\n return end > start;\n });\n // Center timeline around middle of work hours\n const centerTimeline = () => {\n if (!timelineRef.value?.timelineScroll) return;\n // Calculate the middle of work hours\n const workStart = props.employee?.work_start ?? 8;\n const workEnd = props.employee?.work_end ?? 17;\n const centerHour = (workStart + workEnd) / 2;\n const centerPosition = (centerHour - START_HOUR) * hourWidth.value;\n const containerWidth = timelineRef.value.timelineScroll.clientWidth;\n timelineRef.value.timelineScroll.scrollLeft = centerPosition - containerWidth / 2;\n };\n // Watch for date changes or employee changes to re-center\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => [props.modelValue.date, props.employee?.id], () => {\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n });\n // Watch for timeline ref to become available and center it\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(timelineRef, newRef => {\n if (newRef?.timelineScroll) {\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n centerTimeline();\n });\n }\n });\n // Watch for loading state - when data finishes loading, center the timeline\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(isLoading, (newIsLoading, oldIsLoading) => {\n // When loading changes from true to false, timeline is re-rendered\n if (oldIsLoading && !newIsLoading) {\n // Wait for DOM to update, then center\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n setTimeout(() => {\n centerTimeline();\n }, 0); // Small delay to ensure DOM is fully rendered\n });\n }\n });\n // Date navigation\n const previousDay = () => {\n if (!props.modelValue.date) return;\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date);\n const newDate = currentDate.clone().subtract(1, 'day').toDate();\n // Don't allow going to past dates\n if (moment__WEBPACK_IMPORTED_MODULE_10___default()(newDate).isBefore(moment__WEBPACK_IMPORTED_MODULE_10___default()(), 'day')) return;\n updateDate(newDate);\n };\n const nextDay = () => {\n if (!props.modelValue.date) return;\n const currentDate = moment__WEBPACK_IMPORTED_MODULE_10___default()(props.modelValue.date);\n const newDate = currentDate.clone().add(1, 'day').toDate();\n updateDate(newDate);\n };\n // Update handlers\n const updateDate = date => {\n emit('update:modelValue', {\n ...props.modelValue,\n date\n });\n };\n const updateStartTime = event => {\n const target = event.target;\n emit('update:modelValue', {\n ...props.modelValue,\n starts_at_time: target.value\n });\n };\n const updateEndTime = event => {\n const target = event.target;\n emit('update:modelValue', {\n ...props.modelValue,\n ends_at_time: target.value\n });\n };\n // Handle timeblock updated from timeline (drag/drop or quick add)\n const handleTimeblockUpdated = payload => {\n const {\n starts_at_time\n } = payload;\n let {\n ends_at_time\n } = payload;\n // Fix accidental same start/end time by adding 1 hour to end\n if (starts_at_time === ends_at_time) {\n const [hours, minutes] = starts_at_time.split(':').map(Number);\n const newEndHour = (hours + 1) % 24; // Wrap around at midnight\n ends_at_time = `${String(newEndHour).padStart(2, '0')}:${String(minutes).padStart(2, '0')}`;\n }\n emit('update:modelValue', {\n ...props.modelValue,\n starts_at_time,\n ends_at_time\n });\n // Trigger validation after timeline update\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.nextTick)(() => {\n v$.value.$touch();\n });\n };\n // Expose validate method\n const validate = async () => {\n v$.value.$touch();\n const isValid = await v$.value.$validate();\n return isValid && isTimeRangeValid.value;\n };\n __expose({\n validate\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.ends_at_time, () => {\n if (v$.value.ends_at_time.$model !== props.modelValue.ends_at_time) {\n v$.value.ends_at_time.$model = props.modelValue.ends_at_time;\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.starts_at_time, () => {\n if (v$.value.starts_at_time.$model !== props.modelValue.starts_at_time) {\n v$.value.starts_at_time.$model = props.modelValue.starts_at_time;\n console.log('starts_at_time changed', v$.value.starts_at_time.$model);\n }\n });\n (0,vue__WEBPACK_IMPORTED_MODULE_3__.watch)(() => props.modelValue.date, () => {\n if (v$.value.date.$model !== props.modelValue.date) {\n v$.value.date.$model = props.modelValue.date;\n }\n });\n const __returned__ = {\n ALLOW_EDITING_EXISTING_TIMEBLOCKS,\n props,\n emit,\n timelineRef,\n isEditable,\n minDate,\n HOUR_WIDTH,\n HOUR_WIDTH_MOBILE,\n START_HOUR,\n END_HOUR,\n isMobile,\n hourWidth,\n timeRangeValid,\n rules,\n v$,\n hasStartTimeError,\n hasEndTimeError,\n endTimeErrorMessage,\n employeeRef,\n dateRef,\n timeblockRef,\n otherTimeblocksForSameDate,\n editingBlockerIdRef,\n showDraftTasksRef,\n isLoading,\n timelineTasks,\n _scheduledTime,\n _freeTime,\n timeblockDuration,\n refetch,\n conceptTasksRefetch,\n scheduledBlocks,\n otherTimeblocksAsTasks,\n allBlocksForCollisionCheck,\n collision,\n collisionSegments,\n currentTimeblockRange,\n isTimeRangeValid,\n centerTimeline,\n previousDay,\n nextDay,\n updateDate,\n updateStartTime,\n updateEndTime,\n handleTimeblockUpdated,\n validate,\n AEmployeeTimeblockHeader: _a_employee_timeblock_header_vue__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n AEmployeeTimeblockTimeline: _a_employee_timeblock_timeline_vue__WEBPACK_IMPORTED_MODULE_9__[\"default\"]\n };\n Object.defineProperty(__returned__, '__isScriptSetup', {\n enumerable: false,\n value: true\n });\n return __returned__;\n }\n}));\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/employees/a-employee-timeblock.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js!./node_modules/ts-loader/index.js??clonedRuleSet-41.use%5B1%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); /***/ }), @@ -1802,7 +1802,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var vuetify_lib_components_VBtn_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vuetify/lib/components/VBtn/index.mjs */ \"./node_modules/vuetify/lib/components/VBtn/VBtn.mjs\");\n/* harmony import */ var vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuetify/lib/components/VCard/index.mjs */ \"./node_modules/vuetify/lib/components/VCard/VCard.mjs\");\n/* harmony import */ var vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vuetify/lib/components/VCard/index.mjs */ \"./node_modules/vuetify/lib/components/VCard/VCardActions.mjs\");\n/* harmony import */ var vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vuetify/lib/components/VCard/index.mjs */ \"./node_modules/vuetify/lib/components/VCard/VCardText.mjs\");\n/* harmony import */ var vuetify_lib_components_VDialog_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vuetify/lib/components/VDialog/index.mjs */ \"./node_modules/vuetify/lib/components/VDialog/VDialog.mjs\");\n/* harmony import */ var vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vuetify/lib/components/VGrid/index.mjs */ \"./node_modules/vuetify/lib/components/VGrid/VCol.mjs\");\n/* harmony import */ var vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuetify/lib/components/VGrid/index.mjs */ \"./node_modules/vuetify/lib/components/VGrid/VRow.mjs\");\n/* harmony import */ var vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vuetify/lib/components/VIcon/index.mjs */ \"./node_modules/vuetify/lib/components/VIcon/VIcon.mjs\");\n/* harmony import */ var vuetify_lib_components_VSheet_index_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vuetify/lib/components/VSheet/index.mjs */ \"./node_modules/vuetify/lib/components/VSheet/VSheet.mjs\");\n\nconst _hoisted_1 = {\n class: \"d-flex align-center\"\n};\nconst _hoisted_2 = {\n key: 0,\n class: \"d-flex align-center mb-3\"\n};\nconst _hoisted_3 = {\n class: \"d-flex align-center mb-2\"\n};\nconst _hoisted_4 = {\n class: \"d-flex justify-space-between align-center pa-4\"\n};\nconst _hoisted_5 = {\n class: \"d-flex align-start\"\n};\nconst _hoisted_6 = {\n class: \"d-flex justify-space-between align-center\"\n};\nconst _hoisted_7 = {\n class: \"text-red\"\n};\nconst _hoisted_8 = {\n class: \"text-black\"\n};\nconst _hoisted_9 = {\n class: \"d-flex align-start\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n \n \n \n \n const _component_a_reset_size_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-reset-size-button\");\n const _component_a_close_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-close-button\");\n const _component_a_employee_timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-employee-timeblock\");\n \n \n \n const _component_a_resize_handle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-resize-handle\");\n \n \n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_7__.VRow, {\n \"no-gutters\": \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_6__.VCol, {\n cols: \"5\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VSheet_index_mjs__WEBPACK_IMPORTED_MODULE_9__.VSheet, {\n class: \"py-3\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__.VIcon, {\n icon: \"mdi-calendar-week\",\n size: \"large\"\n }), _cache[9] || (_cache[9] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"p\", {\n class: \"mx-3\"\n }, \"Trvanie\", -1 /* CACHED */))])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_6__.VCol, {\n cols: \"7\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VSheet_index_mjs__WEBPACK_IMPORTED_MODULE_9__.VSheet, {\n class: \"py-3\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [!$options.isOffice365Task ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__.VIcon, {\n class: \"add-date cursor-pointer mr-2\",\n icon: \"mdi-plus\",\n size: \"medium\",\n onClick: _cache[0] || (_cache[0] = $event => $data.showModal = true)\n }), _cache[10] || (_cache[10] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"p\", {\n class: \"task-badge rounded-pill\"\n }, \"Pridať záznam\", -1 /* CACHED */))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.timeblocks, (timeblock, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: timeblock.id || `timeblock-${index}`,\n class: \"timeblock-item mb-3\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_3, [!$options.isOffice365Task ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__.VIcon, {\n key: 0,\n class: \"circle-border cursor-pointer mr-2\",\n icon: \"mdi-minus\",\n size: \"medium\",\n onClick: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => timeblock.id ? $options.deleteTimeblock(timeblock) : $options.deleteTimeblockByIndex(index), [\"stop\"])\n }, null, 8 /* PROPS */, [\"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"p\", {\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"task-badge rounded-pill\", {\n 'strike-through': timeblock.is_finished\n }])\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.formatTimeblockStart(timeblock)) + \" - \" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.formatTimeblockEnd(timeblock)), 3 /* TEXT, CLASS */), !$options.isOffice365Task ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__.VIcon, {\n key: 1,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"circle-border ml-2\", {\n completed: timeblock.is_finished,\n 'cursor-pointer': !$props.subtask.is_draft,\n 'disabled-check': $props.subtask.is_draft\n }]),\n icon: \"mdi-check\",\n size: \"medium\",\n onClick: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => !$props.subtask.is_draft && $options.toggleTimeblockIsFinished(timeblock, index), [\"stop\"])\n }, null, 8 /* PROPS */, [\"class\", \"onClick\"])), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $props.subtask.id]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Timeline Visualization for existing timeblock \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" \\n \\n \")]);\n }), 128 /* KEYED_FRAGMENT */))]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VDialog_index_mjs__WEBPACK_IMPORTED_MODULE_5__.VDialog, {\n modelValue: $data.showModal,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = $event => $data.showModal = $event),\n width: _ctx.modalWidth,\n height: _ctx.modalHeight,\n persistent: \"\",\n \"retain-focus\": false\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_2__.VCard, {\n style: {\n \"position\": \"relative\",\n \"height\": \"100%\",\n \"max-height\": \"calc(100vh - 48px)\"\n },\n class: \"add-timeblock-modal\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_4, [_cache[11] || (_cache[11] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"h1\", null, \"Pridať dátum\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_reset_size_button, {\n onReset: _ctx.resetModalSize\n }, null, 8 /* PROPS */, [\"onReset\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_close_button, {\n onClose: _cache[1] || (_cache[1] = $event => $options.closeModal())\n })])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_4__.VCardText, {\n class: \"pa-4\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Reuse the a-employee-timeblock component \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_employee_timeblock, {\n ref: \"employeeTimeblockRef\",\n modelValue: $data.newTimeblock,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => $data.newTimeblock = $event),\n employee: $options.employee,\n deletable: false,\n index: 0\n }, null, 8 /* PROPS */, [\"modelValue\", \"employee\"])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_3__.VCardActions, {\n class: \"pa-4\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VBtn_index_mjs__WEBPACK_IMPORTED_MODULE_1__.VBtn, {\n class: \"button primary\",\n onClick: _cache[3] || (_cache[3] = $event => $options.submitFromEmployeeTimeblock())\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[12] || (_cache[12] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" Potvrdiť \", -1 /* CACHED */)]))]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_resize_handle, {\n \"current-width\": _ctx.modalWidthPx,\n \"current-height\": _ctx.modalHeightPx,\n onResize: _ctx.handleModalResize,\n onResizeEnd: _ctx.handleResizeEnd\n }, null, 8 /* PROPS */, [\"current-width\", \"current-height\", \"onResize\", \"onResizeEnd\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"width\", \"height\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VDialog_index_mjs__WEBPACK_IMPORTED_MODULE_5__.VDialog, {\n modelValue: $data.visible,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = $event => $data.visible = $event),\n width: _ctx.modalWidth,\n height: _ctx.modalHeight,\n persistent: \"\",\n \"retain-focus\": false\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_2__.VCard, {\n style: {\n \"position\": \"relative\",\n \"height\": \"100%\",\n \"max-height\": \"calc(100vh - 48px)\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"h1\", _hoisted_7, [_cache[13] || (_cache[13] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" Ste si istý, že chcete pridať timeblock po deadline \", -1 /* CACHED */)), _cache[14] || (_cache[14] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"br\", null, null, -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"b\", _hoisted_8, \"z mastertasku \" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.subtask?.project_code) + \" ?\", 1 /* TEXT */)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_reset_size_button, {\n onReset: _ctx.resetModalSize\n }, null, 8 /* PROPS */, [\"onReset\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_close_button, {\n onClose: _cache[5] || (_cache[5] = $event => $options.closeModal())\n })])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_3__.VCardActions, {\n class: \"mt-10 d-flex justify-start align-center mobile-view\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VBtn_index_mjs__WEBPACK_IMPORTED_MODULE_1__.VBtn, {\n class: \"button primary half\",\n variant: \"flat\",\n onClick: _cache[6] || (_cache[6] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => $options.confirmSubmit(), [\"stop\"]))\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[15] || (_cache[15] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"ÁNO\", -1 /* CACHED */)]))]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VBtn_index_mjs__WEBPACK_IMPORTED_MODULE_1__.VBtn, {\n class: \"button primary half outline\",\n onClick: _cache[7] || (_cache[7] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => $options.closeModal(), [\"stop\"]))\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[16] || (_cache[16] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"ZRUŠIŤ\", -1 /* CACHED */)]))]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_resize_handle, {\n \"current-width\": _ctx.modalWidthPx,\n \"current-height\": _ctx.modalHeightPx,\n onResize: _ctx.handleModalResize,\n onResizeEnd: _ctx.handleResizeEnd\n }, null, 8 /* PROPS */, [\"current-width\", \"current-height\", \"onResize\", \"onResizeEnd\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"width\", \"height\"])], 64 /* STABLE_FRAGMENT */);\n}\n\n/* Vuetify */\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/_components/a-task-timeblocks.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B5%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); +eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var vuetify_lib_components_VBtn_index_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vuetify/lib/components/VBtn/index.mjs */ \"./node_modules/vuetify/lib/components/VBtn/VBtn.mjs\");\n/* harmony import */ var vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vuetify/lib/components/VCard/index.mjs */ \"./node_modules/vuetify/lib/components/VCard/VCard.mjs\");\n/* harmony import */ var vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vuetify/lib/components/VCard/index.mjs */ \"./node_modules/vuetify/lib/components/VCard/VCardActions.mjs\");\n/* harmony import */ var vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vuetify/lib/components/VCard/index.mjs */ \"./node_modules/vuetify/lib/components/VCard/VCardText.mjs\");\n/* harmony import */ var vuetify_lib_components_VDialog_index_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vuetify/lib/components/VDialog/index.mjs */ \"./node_modules/vuetify/lib/components/VDialog/VDialog.mjs\");\n/* harmony import */ var vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! vuetify/lib/components/VGrid/index.mjs */ \"./node_modules/vuetify/lib/components/VGrid/VCol.mjs\");\n/* harmony import */ var vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! vuetify/lib/components/VGrid/index.mjs */ \"./node_modules/vuetify/lib/components/VGrid/VRow.mjs\");\n/* harmony import */ var vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vuetify/lib/components/VIcon/index.mjs */ \"./node_modules/vuetify/lib/components/VIcon/VIcon.mjs\");\n/* harmony import */ var vuetify_lib_components_VSheet_index_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! vuetify/lib/components/VSheet/index.mjs */ \"./node_modules/vuetify/lib/components/VSheet/VSheet.mjs\");\n\nconst _hoisted_1 = {\n class: \"d-flex align-center\"\n};\nconst _hoisted_2 = {\n key: 0,\n class: \"d-flex align-center mb-3\"\n};\nconst _hoisted_3 = {\n class: \"d-flex align-center mb-2\"\n};\nconst _hoisted_4 = {\n class: \"d-flex justify-space-between align-center pa-4\"\n};\nconst _hoisted_5 = {\n class: \"d-flex align-start\"\n};\nconst _hoisted_6 = {\n class: \"d-flex justify-space-between align-center\"\n};\nconst _hoisted_7 = {\n class: \"text-red\"\n};\nconst _hoisted_8 = {\n class: \"text-black\"\n};\nconst _hoisted_9 = {\n class: \"d-flex align-start\"\n};\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n \n \n \n \n const _component_a_reset_size_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-reset-size-button\");\n const _component_a_close_button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-close-button\");\n const _component_a_employee_timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-employee-timeblock\");\n \n \n \n const _component_a_resize_handle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"a-resize-handle\");\n \n \n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_7__.VRow, {\n \"no-gutters\": \"\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_6__.VCol, {\n cols: \"5\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VSheet_index_mjs__WEBPACK_IMPORTED_MODULE_9__.VSheet, {\n class: \"py-3\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__.VIcon, {\n icon: \"mdi-calendar-week\",\n size: \"large\"\n }), _cache[9] || (_cache[9] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"p\", {\n class: \"mx-3\"\n }, \"Trvanie\", -1 /* CACHED */))])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VGrid_index_mjs__WEBPACK_IMPORTED_MODULE_6__.VCol, {\n cols: \"7\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VSheet_index_mjs__WEBPACK_IMPORTED_MODULE_9__.VSheet, {\n class: \"py-3\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [!$options.isOffice365Task ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__.VIcon, {\n class: \"add-date cursor-pointer mr-2\",\n icon: \"mdi-plus\",\n size: \"medium\",\n onClick: _cache[0] || (_cache[0] = $event => $data.showModal = true)\n }), _cache[10] || (_cache[10] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"p\", {\n class: \"task-badge rounded-pill\"\n }, \"Pridať záznam\", -1 /* CACHED */))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.timeblocks, (timeblock, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: timeblock.id || `timeblock-${index}`,\n class: \"timeblock-item mb-3\"\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_3, [!$options.isOffice365Task ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__.VIcon, {\n key: 0,\n class: \"circle-border cursor-pointer mr-2\",\n icon: \"mdi-minus\",\n size: \"medium\",\n onClick: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => timeblock.id ? $options.deleteTimeblock(timeblock) : $options.deleteTimeblockByIndex(index), [\"stop\"])\n }, null, 8 /* PROPS */, [\"onClick\"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"p\", {\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"task-badge rounded-pill\", {\n 'strike-through': timeblock.is_finished\n }])\n }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.formatTimeblockStart(timeblock)) + \" - \" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($options.formatTimeblockEnd(timeblock)), 3 /* TEXT, CLASS */), !$options.isOffice365Task ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(vuetify_lib_components_VIcon_index_mjs__WEBPACK_IMPORTED_MODULE_8__.VIcon, {\n key: 1,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([\"circle-border ml-2\", {\n completed: timeblock.is_finished,\n 'cursor-pointer': !$props.subtask.is_draft,\n 'disabled-check': $props.subtask.is_draft\n }]),\n icon: \"mdi-check\",\n size: \"medium\",\n onClick: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => !$props.subtask.is_draft && $options.toggleTimeblockIsFinished(timeblock, index), [\"stop\"])\n }, null, 8 /* PROPS */, [\"class\", \"onClick\"])), [[vue__WEBPACK_IMPORTED_MODULE_0__.vShow, $props.subtask.id]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Timeline Visualization for existing timeblock \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" \\n \\n \")]);\n }), 128 /* KEYED_FRAGMENT */))]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VDialog_index_mjs__WEBPACK_IMPORTED_MODULE_5__.VDialog, {\n modelValue: $data.showModal,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = $event => $data.showModal = $event),\n width: _ctx.modalWidth,\n height: _ctx.modalHeight,\n persistent: \"\",\n \"retain-focus\": false\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_2__.VCard, {\n style: {\n \"position\": \"relative\",\n \"height\": \"100%\",\n \"max-height\": \"calc(100vh - 48px)\"\n },\n class: \"add-timeblock-modal\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_4, [_cache[11] || (_cache[11] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"h1\", null, \"Pridať dátum\", -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_reset_size_button, {\n onReset: _ctx.resetModalSize\n }, null, 8 /* PROPS */, [\"onReset\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_close_button, {\n onClose: _cache[1] || (_cache[1] = $event => $options.closeModal())\n })])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_4__.VCardText, {\n class: \"pa-4\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Reuse the a-employee-timeblock component \"), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_employee_timeblock, {\n ref: \"employeeTimeblockRef\",\n modelValue: $data.newTimeblock,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = $event => $data.newTimeblock = $event),\n employee: $options.employee,\n deletable: false,\n index: 0,\n \"show-draft-tasks\": !!$props.subtask.is_draft\n }, null, 8 /* PROPS */, [\"modelValue\", \"employee\", \"show-draft-tasks\"])]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_3__.VCardActions, {\n class: \"pa-4\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VBtn_index_mjs__WEBPACK_IMPORTED_MODULE_1__.VBtn, {\n class: \"button primary\",\n onClick: _cache[3] || (_cache[3] = $event => $options.submitFromEmployeeTimeblock())\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[12] || (_cache[12] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" Potvrdiť \", -1 /* CACHED */)]))]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_resize_handle, {\n \"current-width\": _ctx.modalWidthPx,\n \"current-height\": _ctx.modalHeightPx,\n onResize: _ctx.handleModalResize,\n onResizeEnd: _ctx.handleResizeEnd\n }, null, 8 /* PROPS */, [\"current-width\", \"current-height\", \"onResize\", \"onResizeEnd\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"width\", \"height\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VDialog_index_mjs__WEBPACK_IMPORTED_MODULE_5__.VDialog, {\n modelValue: $data.visible,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = $event => $data.visible = $event),\n width: _ctx.modalWidth,\n height: _ctx.modalHeight,\n persistent: \"\",\n \"retain-focus\": false\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_2__.VCard, {\n style: {\n \"position\": \"relative\",\n \"height\": \"100%\",\n \"max-height\": \"calc(100vh - 48px)\"\n }\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"h1\", _hoisted_7, [_cache[13] || (_cache[13] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\" Ste si istý, že chcete pridať timeblock po deadline \", -1 /* CACHED */)), _cache[14] || (_cache[14] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"br\", null, null, -1 /* CACHED */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"b\", _hoisted_8, \"z mastertasku \" + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.subtask?.project_code) + \" ?\", 1 /* TEXT */)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)(\"div\", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_reset_size_button, {\n onReset: _ctx.resetModalSize\n }, null, 8 /* PROPS */, [\"onReset\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_close_button, {\n onClose: _cache[5] || (_cache[5] = $event => $options.closeModal())\n })])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VCard_index_mjs__WEBPACK_IMPORTED_MODULE_3__.VCardActions, {\n class: \"mt-10 d-flex justify-start align-center mobile-view\"\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VBtn_index_mjs__WEBPACK_IMPORTED_MODULE_1__.VBtn, {\n class: \"button primary half\",\n variant: \"flat\",\n onClick: _cache[6] || (_cache[6] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => $options.confirmSubmit(), [\"stop\"]))\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[15] || (_cache[15] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"ÁNO\", -1 /* CACHED */)]))]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vuetify_lib_components_VBtn_index_mjs__WEBPACK_IMPORTED_MODULE_1__.VBtn, {\n class: \"button primary half outline\",\n onClick: _cache[7] || (_cache[7] = (0,vue__WEBPACK_IMPORTED_MODULE_0__.withModifiers)($event => $options.closeModal(), [\"stop\"]))\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(() => [...(_cache[16] || (_cache[16] = [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(\"ZRUŠIŤ\", -1 /* CACHED */)]))]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_a_resize_handle, {\n \"current-width\": _ctx.modalWidthPx,\n \"current-height\": _ctx.modalHeightPx,\n onResize: _ctx.handleModalResize,\n onResizeEnd: _ctx.handleResizeEnd\n }, null, 8 /* PROPS */, [\"current-width\", \"current-height\", \"onResize\", \"onResizeEnd\"])]),\n _: 1 /* STABLE */\n })]),\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\", \"width\", \"height\"])], 64 /* STABLE_FRAGMENT */);\n}\n\n/* Vuetify */\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/_components/a-task-timeblocks.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B5%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); /***/ }), @@ -1813,7 +1813,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpa /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_A_mastertask_name = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-mastertask-name\");\n const _component_A_mastertask_status = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-mastertask-status\");\n const _component_A_task_deadline = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-deadline\");\n const _component_Z_created_by = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"Z-created-by\");\n const _component_A_task_assigned_employee = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-assigned-employee\");\n const _component_A_task_planned_time = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-planned-time\");\n const _component_A_task_timeblocks = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-timeblocks\");\n const _component_A_task_remaining_time = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-remaining-time\");\n const _component_A_task_spent_time = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-spent-time\");\n const _component_A_task_description = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-description\");\n const _component_Z_files = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"Z-files\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_mastertask_name, {\n id: $props.subtask.master_task_id,\n name: $props.subtask._master_task.name,\n color: $props.subtask._master_task.color,\n onCloseModal: _cache[0] || (_cache[0] = $event => _ctx.$emit('close-modal'))\n }, null, 8 /* PROPS */, [\"id\", \"name\", \"color\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_mastertask_status, {\n \"is-finished\": $props.subtask.is_finished\n }, null, 8 /* PROPS */, [\"is-finished\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_deadline, {\n subtask: $props.subtask\n }, null, 8 /* PROPS */, [\"subtask\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Z_created_by, {\n \"employee-id\": $props.subtask.created_by\n }, null, 8 /* PROPS */, [\"employee-id\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Loop through normalized employees \"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($options.normalizedEmployees, (employeeData, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: `employee-${employeeData.id || index}`,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({\n 'employee-section': $options.hasMultipleEmployees,\n 'border-top': $options.hasMultipleEmployees,\n 'border-bottom': $options.hasMultipleEmployees && index === $options.normalizedEmployees.length - 1\n })\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_assigned_employee, {\n employee: employeeData._employee\n }, null, 8 /* PROPS */, [\"employee\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_planned_time, {\n hours: employeeData.duration\n }, null, 8 /* PROPS */, [\"hours\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_timeblocks, {\n timeblocks: employeeData.timeblocks,\n subtask: {\n ...$props.subtask,\n employee_id: employeeData.id,\n timeblocks: employeeData.timeblocks\n },\n onUpdateSubtask: _cache[1] || (_cache[1] = $event => _ctx.$emit('update-subtask', $event))\n }, null, 8 /* PROPS */, [\"timeblocks\", \"subtask\"])], 2 /* CLASS */);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Remaining/spent time only for single employee (not in multi-employee drafts) \"), !$options.hasMultipleEmployees ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n key: 0\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_remaining_time, {\n hours: $props.subtask.duration - $props.subtask.spent_time\n }, null, 8 /* PROPS */, [\"hours\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_spent_time, {\n hours: $props.subtask.spent_time,\n subtask: $props.subtask\n }, null, 8 /* PROPS */, [\"hours\", \"subtask\"])], 64 /* STABLE_FRAGMENT */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_description, {\n description: $props.subtask.description,\n \"mastertask-description\": $props.subtask.master_task_description\n }, null, 8 /* PROPS */, [\"description\", \"mastertask-description\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Z_files, {\n files: $props.subtask.files\n }, null, 8 /* PROPS */, [\"files\"])], 64 /* STABLE_FRAGMENT */);\n}\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/z-task-readonly-info.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B5%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); +eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_A_mastertask_name = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-mastertask-name\");\n const _component_A_mastertask_status = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-mastertask-status\");\n const _component_A_task_deadline = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-deadline\");\n const _component_Z_created_by = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"Z-created-by\");\n const _component_A_task_assigned_employee = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-assigned-employee\");\n const _component_A_task_planned_time = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-planned-time\");\n const _component_A_task_timeblocks = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-timeblocks\");\n const _component_A_task_remaining_time = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-remaining-time\");\n const _component_A_task_spent_time = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-spent-time\");\n const _component_A_task_description = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"A-task-description\");\n const _component_Z_files = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)(\"Z-files\");\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_mastertask_name, {\n id: $props.subtask.master_task_id,\n name: $props.subtask._master_task.name,\n color: $props.subtask._master_task.color,\n onCloseModal: _cache[0] || (_cache[0] = $event => _ctx.$emit('close-modal'))\n }, null, 8 /* PROPS */, [\"id\", \"name\", \"color\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_mastertask_status, {\n \"is-finished\": $props.subtask.is_finished\n }, null, 8 /* PROPS */, [\"is-finished\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_deadline, {\n subtask: $props.subtask\n }, null, 8 /* PROPS */, [\"subtask\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Z_created_by, {\n \"employee-id\": $props.subtask.created_by\n }, null, 8 /* PROPS */, [\"employee-id\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Loop through normalized employees \"), ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($options.normalizedEmployees, (employeeData, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(\"div\", {\n key: `employee-${employeeData.id || index}`,\n class: (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({\n 'employee-section': $options.hasMultipleEmployees,\n 'border-top': $options.hasMultipleEmployees,\n 'border-bottom': $options.hasMultipleEmployees && index === $options.normalizedEmployees.length - 1\n })\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_assigned_employee, {\n employee: employeeData._employee\n }, null, 8 /* PROPS */, [\"employee\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_planned_time, {\n hours: employeeData.duration\n }, null, 8 /* PROPS */, [\"hours\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_timeblocks, {\n timeblocks: employeeData.timeblocks,\n subtask: {\n ...$props.subtask,\n employee_id: employeeData.id,\n _employee: employeeData._employee,\n timeblocks: employeeData.timeblocks\n },\n onUpdateSubtask: _cache[1] || (_cache[1] = $event => _ctx.$emit('update-subtask', $event))\n }, null, 8 /* PROPS */, [\"timeblocks\", \"subtask\"])], 2 /* CLASS */);\n }), 128 /* KEYED_FRAGMENT */)), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\" Remaining/spent time only for single employee (not in multi-employee drafts) \"), !$options.hasMultipleEmployees ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {\n key: 0\n }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_remaining_time, {\n hours: $props.subtask.duration - $props.subtask.spent_time\n }, null, 8 /* PROPS */, [\"hours\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_spent_time, {\n hours: $props.subtask.spent_time,\n subtask: $props.subtask\n }, null, 8 /* PROPS */, [\"hours\", \"subtask\"])], 64 /* STABLE_FRAGMENT */)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(\"v-if\", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_A_task_description, {\n description: $props.subtask.description,\n \"mastertask-description\": $props.subtask.master_task_description\n }, null, 8 /* PROPS */, [\"description\", \"mastertask-description\"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Z_files, {\n files: $props.subtask.files\n }, null, 8 /* PROPS */, [\"files\"])], 64 /* STABLE_FRAGMENT */);\n}\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@modal/task/_components/z-task-readonly-info.vue?./node_modules/webpack-plugin-vuetify/dist/scriptLoader.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use%5B0%5D!./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B5%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B0%5D.use%5B0%5D\n}"); /***/ }), @@ -2699,7 +2699,7 @@ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var cor /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useEmployeeTimeline: function() { return /* binding */ useEmployeeTimeline; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ \"./node_modules/core-js/modules/esnext.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ \"./node_modules/core-js/modules/esnext.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _tanstack_vue_query__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tanstack/vue-query */ \"./node_modules/@tanstack/vue-query/build/modern/useQuery.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/plugins/w@custom/axios/models/axios */ \"./src/plugins/w@custom/axios/models/axios.ts\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _plugins_tm_dashboard_tasks_utils_timeline_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/plugins/tm@dashboard/tasks/_utils/timeline.utils */ \"./src/plugins/tm@dashboard/tasks/_utils/timeline.utils.ts\");\n/* harmony import */ var _timeblock_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./timeblock.utils */ \"./src/plugins/tm@_utils/timeblock.utils.ts\");\n/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ \"./node_modules/console-browserify/index.js\");\n\n\n\n\n\n\n\n\n\nfunction useEmployeeTimeline(employee, date, currentTimeblock, otherLocalTimeblocks, editingBlockerId) {\n // Fetch employee's tasks for the selected date\n const {\n data: tasksData,\n isLoading,\n error,\n refetch\n } = (0,_tanstack_vue_query__WEBPACK_IMPORTED_MODULE_3__.useQuery)({\n queryKey: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => ['employee-timeline', (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee)?.id, (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date) ? moment__WEBPACK_IMPORTED_MODULE_6___default()((0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date)).format('YYYY-MM-DD') : null]),\n queryFn: async () => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!emp?.id || !d) {\n return null;\n }\n const dateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(d).format('YYYY-MM-DD');\n const queryParams = new URLSearchParams({\n start: dateStr,\n end: dateStr,\n employee_id: emp.id.toString()\n }).toString();\n const response = await _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get_auth(`v1/subtasks?${queryParams}`);\n return response;\n },\n enabled: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n return !!(emp?.id && d);\n })\n });\n const {\n data: conceptTasksData,\n isLoading: conceptTasksLoading,\n error: conceptTasksError,\n refetch: conceptTasksRefetch\n } = (0,_tanstack_vue_query__WEBPACK_IMPORTED_MODULE_3__.useQuery)({\n queryKey: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => ['concept-employee-timeline', (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee)?.id, (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date) ? moment__WEBPACK_IMPORTED_MODULE_6___default()((0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date)).format('YYYY-MM-DD') : null]),\n queryFn: async () => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!emp?.id || !d) {\n return null;\n }\n const dateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(d).format('YYYY-MM-DD');\n const queryParams = new URLSearchParams({\n start: dateStr,\n end: dateStr,\n employee_id: emp.id.toString(),\n type: 'draft'\n }).toString();\n const response = await _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_5__[\"default\"].get_auth(`v1/subtasks?${queryParams}`);\n return response;\n },\n enabled: (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n return !!(emp?.id && d);\n })\n });\n // Generate timeline tasks from fetched data\n const timelineTasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const data = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(tasksData);\n const conceptData = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(conceptTasksData);\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n const excludeBlockerId = editingBlockerId ? (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(editingBlockerId) : null;\n if (!data || !conceptData || !emp || !d) {\n return [];\n }\n const subtasks = [...(data.subtasks || []), ...(data.blockers || []), ...(conceptData.subtasks || [])];\n const selectedDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(d).format('YYYY-MM-DD');\n try {\n // Process timeblocks directly instead of using timeline utils\n // which is designed for multi-day views\n const tasks = [];\n subtasks.forEach(subtask => {\n // Check if this is a blocker/adhoc/etc with direct start/end fields (no timeblocks array)\n if (!subtask.timeblocks && subtask.start && subtask.end && ['blocker', 'adhoc', 'home_office', 'vacation', 'free_day', 'office365_blocker'].includes(subtask.type)) {\n // Skip the blocker being edited\n if (excludeBlockerId && subtask.id === excludeBlockerId) {\n return;\n }\n const blockerDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(subtask.start).format('YYYY-MM-DD');\n if (blockerDateStr === selectedDateStr) {\n const type = subtask.type;\n const task = {\n id: subtask.id,\n start: new Date(subtask.start),\n end: new Date(subtask.end),\n master_task: null,\n date: new Date(subtask.start),\n project_code: null,\n subtask: subtask,\n is_draft: !!subtask.is_draft,\n blocker: subtask,\n type,\n _timeblock_id: null,\n _timeblock_is_finished: subtask.is_finished || false,\n _real_start: new Date(subtask.start),\n _real_end: new Date(subtask.end)\n };\n tasks.push(task);\n }\n } else {\n // Process regular subtasks with timeblocks array\n subtask.timeblocks?.forEach(timeblock => {\n const timeblockDateStr = moment__WEBPACK_IMPORTED_MODULE_6___default()(timeblock.start).format('YYYY-MM-DD');\n // Only include timeblocks for the selected date\n if (timeblockDateStr === selectedDateStr) {\n let type = 'subtask';\n if (subtask.type === 'office365') type = 'office365';\n const task = {\n id: subtask.id,\n start: new Date(timeblock.start),\n end: new Date(timeblock.end),\n master_task: subtask.master_task,\n date: new Date(timeblock.start),\n project_code: subtask.project_code,\n subtask: subtask,\n is_draft: !!subtask.is_draft,\n blocker: undefined,\n type,\n _timeblock_id: timeblock.id,\n _timeblock_is_finished: timeblock.is_finished,\n _real_start: new Date(timeblock.start),\n _real_end: new Date(timeblock.end)\n };\n tasks.push(task);\n }\n });\n }\n });\n return tasks;\n } catch (error) {\n console.error('Error generating timeline tasks:', error);\n return [];\n }\n });\n // Calculate scheduled time for the day (in hours)\n const scheduledTime = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n if (!tasks || !d) return 0;\n let totalMinutes = 0;\n tasks.forEach(task => {\n if (task.type === 'non-working-hours' || task.subtask?.is_finished || task.blocker?.is_finished) {\n return;\n }\n totalMinutes += _plugins_tm_dashboard_tasks_utils_timeline_utils__WEBPACK_IMPORTED_MODULE_7__[\"default\"]._getDifferenceInMinutes(task._real_end, task._real_start);\n });\n return (totalMinutes / 60).toFixed(1);\n });\n // Calculate free/unscheduled time for the day (in hours)\n const freeTime = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(date);\n const scheduled = parseFloat(String((0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(scheduledTime)));\n if (!emp || !d) return '0';\n // Calculate duration of other local unsaved timeblocks for the same date\n let localTimeblocksHours = 0;\n if (otherLocalTimeblocks) {\n const localTbs = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(otherLocalTimeblocks) || [];\n localTbs.forEach(tb => {\n // Only count timeblocks with complete time data\n if (tb.starts_at_time && tb.ends_at_time) {\n localTimeblocksHours += (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(tb);\n }\n });\n }\n // Also include the current timeblock if it has both start and end times\n const currentTb = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n if (currentTb?.starts_at_time && currentTb?.ends_at_time) {\n localTimeblocksHours += (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(currentTb);\n }\n const dailyCapacityHours = emp.work_end - emp.work_start;\n return (dailyCapacityHours - scheduled - localTimeblocksHours).toFixed(1);\n });\n // Detect collisions with current timeblock\n const collision = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n if (!timeblock || !tasks) {\n return {\n hasCollision: false,\n startCollides: false,\n endCollides: false,\n collidingTasks: []\n };\n }\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.detectCollision)(timeblock, tasks);\n });\n // Get collision segments for timeline visualization\n const collisionSegments = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(timelineTasks);\n if (!timeblock || !tasks) {\n return [];\n }\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.getCollisionSegments)(timeblock, tasks);\n });\n // Calculate current timeblock duration\n const timeblockDuration = (0,vue__WEBPACK_IMPORTED_MODULE_4__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_4__.unref)(currentTimeblock);\n if (!timeblock) return 0;\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_8__.calculateTimeblockDuration)(timeblock);\n });\n return {\n // Query states\n isLoading,\n error,\n refetch,\n conceptTasksLoading,\n conceptTasksError,\n conceptTasksRefetch,\n // Timeline data\n timelineTasks,\n scheduledTime,\n freeTime,\n // Collision detection\n collision,\n collisionSegments,\n timeblockDuration\n };\n}\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@_utils/useEmployeeTimeline.ts?\n}"); +eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useEmployeeTimeline: function() { return /* binding */ useEmployeeTimeline; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ \"./node_modules/core-js/modules/esnext.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_esnext_iterator_find_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/esnext.iterator.find.js */ \"./node_modules/core-js/modules/esnext.iterator.find.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_find_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_find_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ \"./node_modules/core-js/modules/esnext.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_esnext_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _tanstack_vue_query__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tanstack/vue-query */ \"./node_modules/@tanstack/vue-query/build/modern/useQuery.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.runtime.esm-bundler.js\");\n/* harmony import */ var _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/plugins/w@custom/axios/models/axios */ \"./src/plugins/w@custom/axios/models/axios.ts\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! moment */ \"./node_modules/moment/moment.js\");\n/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _plugins_tm_dashboard_tasks_utils_timeline_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/plugins/tm@dashboard/tasks/_utils/timeline.utils */ \"./src/plugins/tm@dashboard/tasks/_utils/timeline.utils.ts\");\n/* harmony import */ var _timeblock_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./timeblock.utils */ \"./src/plugins/tm@_utils/timeblock.utils.ts\");\n/* provided dependency */ var console = __webpack_require__(/*! ./node_modules/console-browserify/index.js */ \"./node_modules/console-browserify/index.js\");\n\n\n\n\n\n\n\n\n\n\nfunction useEmployeeTimeline(employee, date, currentTimeblock, otherLocalTimeblocks, editingBlockerId, showDraftTasks) {\n // Fetch employee's tasks for the selected date\n const {\n data: tasksData,\n isLoading,\n error,\n refetch\n } = (0,_tanstack_vue_query__WEBPACK_IMPORTED_MODULE_4__.useQuery)({\n queryKey: (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => ['employee-timeline', (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(employee)?.id, (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date) ? moment__WEBPACK_IMPORTED_MODULE_7___default()((0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date)).format('YYYY-MM-DD') : null]),\n queryFn: async () => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date);\n if (!emp?.id || !d) {\n return null;\n }\n const dateStr = moment__WEBPACK_IMPORTED_MODULE_7___default()(d).format('YYYY-MM-DD');\n const queryParams = new URLSearchParams({\n start: dateStr,\n end: dateStr,\n employee_id: emp.id.toString()\n }).toString();\n const response = await _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_6__[\"default\"].get_auth(`v1/subtasks?${queryParams}`);\n return response;\n },\n enabled: (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date);\n return !!(emp?.id && d);\n })\n });\n const {\n data: conceptTasksData,\n isLoading: conceptTasksLoading,\n error: conceptTasksError,\n refetch: conceptTasksRefetch\n } = (0,_tanstack_vue_query__WEBPACK_IMPORTED_MODULE_4__.useQuery)({\n queryKey: (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => ['concept-employee-timeline', (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(employee)?.id, (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date) ? moment__WEBPACK_IMPORTED_MODULE_7___default()((0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date)).format('YYYY-MM-DD') : null]),\n queryFn: async () => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date);\n if (!emp?.id || !d) {\n return null;\n }\n const dateStr = moment__WEBPACK_IMPORTED_MODULE_7___default()(d).format('YYYY-MM-DD');\n const queryParams = new URLSearchParams({\n start: dateStr,\n end: dateStr,\n employee_id: emp.id.toString(),\n type: 'draft'\n }).toString();\n const response = await _plugins_w_custom_axios_models_axios__WEBPACK_IMPORTED_MODULE_6__[\"default\"].get_auth(`v1/subtasks?${queryParams}`);\n return response;\n },\n enabled: (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date);\n return !!(emp?.id && d);\n })\n });\n // Generate timeline tasks from fetched data\n const timelineTasks = (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => {\n const data = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(tasksData);\n const conceptData = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(conceptTasksData);\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date);\n const excludeBlockerId = editingBlockerId ? (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(editingBlockerId) : null;\n const includeDrafts = showDraftTasks ? (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(showDraftTasks) : false;\n if (!data || !conceptData || !emp || !d) {\n return [];\n }\n const subtasks = [...(data.subtasks || []), ...(data.blockers || []),\n // Only include concept tasks if showDraftTasks is true\n ...(includeDrafts ? conceptData.subtasks || [] : [])];\n const selectedDateStr = moment__WEBPACK_IMPORTED_MODULE_7___default()(d).format('YYYY-MM-DD');\n try {\n // Process timeblocks directly instead of using timeline utils\n // which is designed for multi-day views\n const tasks = [];\n subtasks.forEach(subtask => {\n // Check if this is a blocker/adhoc/etc with direct start/end fields (no timeblocks array)\n if (!subtask.timeblocks && subtask.start && subtask.end && ['blocker', 'adhoc', 'home_office', 'vacation', 'free_day', 'office365_blocker'].includes(subtask.type)) {\n // Skip the blocker being edited\n if (excludeBlockerId && subtask.id === excludeBlockerId) {\n return;\n }\n const blockerDateStr = moment__WEBPACK_IMPORTED_MODULE_7___default()(subtask.start).format('YYYY-MM-DD');\n if (blockerDateStr === selectedDateStr) {\n const type = subtask.type;\n const task = {\n id: subtask.id,\n start: new Date(subtask.start),\n end: new Date(subtask.end),\n master_task: null,\n date: new Date(subtask.start),\n project_code: null,\n subtask: subtask,\n is_draft: !!subtask.is_draft,\n blocker: subtask,\n type,\n _timeblock_id: null,\n _timeblock_is_finished: subtask.is_finished || false,\n _real_start: new Date(subtask.start),\n _real_end: new Date(subtask.end)\n };\n tasks.push(task);\n }\n } else {\n // Determine the correct timeblocks array based on task type\n let timeblocks;\n // For draft tasks with employees array, get timeblocks from the matching employee\n if (subtask.is_draft && Array.isArray(subtask.employees)) {\n const employeeData = subtask.employees.find(empData => Number(empData.id) === Number(emp.id));\n timeblocks = employeeData?.timeblocks;\n } else {\n // For regular tasks, use root-level timeblocks array\n timeblocks = subtask.timeblocks;\n }\n // Process timeblocks (same logic for both regular and concept tasks)\n timeblocks?.forEach(timeblock => {\n const timeblockDateStr = moment__WEBPACK_IMPORTED_MODULE_7___default()(timeblock.start).format('YYYY-MM-DD');\n // Only include timeblocks for the selected date\n if (timeblockDateStr === selectedDateStr) {\n let type = 'subtask';\n if (subtask.type === 'office365') type = 'office365';\n const task = {\n id: subtask.id,\n start: new Date(timeblock.start),\n end: new Date(timeblock.end),\n master_task: subtask.master_task,\n date: new Date(timeblock.start),\n project_code: subtask.project_code,\n subtask: subtask,\n is_draft: !!subtask.is_draft,\n blocker: undefined,\n type,\n _timeblock_id: timeblock.id,\n _timeblock_is_finished: timeblock.is_finished,\n _real_start: new Date(timeblock.start),\n _real_end: new Date(timeblock.end)\n };\n tasks.push(task);\n }\n });\n }\n });\n return tasks;\n } catch (error) {\n console.error('Error generating timeline tasks:', error);\n return [];\n }\n });\n // Calculate scheduled time for the day (in hours)\n const scheduledTime = (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => {\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(timelineTasks);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date);\n if (!tasks || !d) return 0;\n let totalMinutes = 0;\n tasks.forEach(task => {\n if (task.type === 'non-working-hours' || task.subtask?.is_finished || task.blocker?.is_finished) {\n return;\n }\n totalMinutes += _plugins_tm_dashboard_tasks_utils_timeline_utils__WEBPACK_IMPORTED_MODULE_8__[\"default\"]._getDifferenceInMinutes(task._real_end, task._real_start);\n });\n return (totalMinutes / 60).toFixed(1);\n });\n // Calculate free/unscheduled time for the day (in hours)\n const freeTime = (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => {\n const emp = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(employee);\n const d = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(date);\n const scheduled = parseFloat(String((0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(scheduledTime)));\n if (!emp || !d) return '0';\n // Calculate duration of other local unsaved timeblocks for the same date\n let localTimeblocksHours = 0;\n if (otherLocalTimeblocks) {\n const localTbs = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(otherLocalTimeblocks) || [];\n localTbs.forEach(tb => {\n // Only count timeblocks with complete time data\n if (tb.starts_at_time && tb.ends_at_time) {\n localTimeblocksHours += (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_9__.calculateTimeblockDuration)(tb);\n }\n });\n }\n // Also include the current timeblock if it has both start and end times\n const currentTb = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(currentTimeblock);\n if (currentTb?.starts_at_time && currentTb?.ends_at_time) {\n localTimeblocksHours += (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_9__.calculateTimeblockDuration)(currentTb);\n }\n const dailyCapacityHours = emp.work_end - emp.work_start;\n return (dailyCapacityHours - scheduled - localTimeblocksHours).toFixed(1);\n });\n // Detect collisions with current timeblock\n const collision = (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(currentTimeblock);\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(timelineTasks);\n if (!timeblock || !tasks) {\n return {\n hasCollision: false,\n startCollides: false,\n endCollides: false,\n collidingTasks: []\n };\n }\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_9__.detectCollision)(timeblock, tasks);\n });\n // Get collision segments for timeline visualization\n const collisionSegments = (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(currentTimeblock);\n const tasks = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(timelineTasks);\n if (!timeblock || !tasks) {\n return [];\n }\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_9__.getCollisionSegments)(timeblock, tasks);\n });\n // Calculate current timeblock duration\n const timeblockDuration = (0,vue__WEBPACK_IMPORTED_MODULE_5__.computed)(() => {\n const timeblock = (0,vue__WEBPACK_IMPORTED_MODULE_5__.unref)(currentTimeblock);\n if (!timeblock) return 0;\n return (0,_timeblock_utils__WEBPACK_IMPORTED_MODULE_9__.calculateTimeblockDuration)(timeblock);\n });\n return {\n // Query states\n isLoading,\n error,\n refetch,\n conceptTasksLoading,\n conceptTasksError,\n conceptTasksRefetch,\n // Timeline data\n timelineTasks,\n scheduledTime,\n freeTime,\n // Collision detection\n collision,\n collisionSegments,\n timeblockDuration\n };\n}\n\n//# sourceURL=webpack://jandl/./src/plugins/tm@_utils/useEmployeeTimeline.ts?\n}"); /***/ }),